
git
yzlh2009
这个作者很懒,什么都没留下…
展开
-
git add .后还提示Changes not staged for commit
git add .后还提示Changes not staged for commit,原因很可能是当前文件夹处在另一个仓库的子目录下,检查一下。原创 2021-01-16 19:33:34 · 732 阅读 · 0 评论 -
报错sign_and_send_pubkey: signing failed: agent refused operation
sign_and_send_pubkey: signing failed: agent refused operationPermission denied (publickey).执行以下命令就可以了。eval "$(ssh-agent -s)"ssh-add原创 2020-01-08 02:56:49 · 359 阅读 · 0 评论 -
git pull操作的时候提示fatal: Could not read from remote repository.的解决方法
fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.有时加上 -f 可以解决问题,不行再来一次,原因暂时不太理解。...原创 2019-12-30 19:04:30 · 662 阅读 · 0 评论 -
git pull时出现了 ! [rejected] master -> master (non-fast-forward)
有人是在push时出现 ! [rejected] ,我在pull时也碰到了,尝试pull --rebase也没有解决。解决方案:换一个没有.git信息的目录。原创 2019-12-30 17:32:37 · 3562 阅读 · 0 评论 -
error: failed to push some refs to 'git@github.com:
git push的时候出现如下提示:error: failed to push some refs to 'git@github.com:解读后面的提示。hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused...原创 2019-12-28 22:26:08 · 157 阅读 · 0 评论 -
关于提示:You asked to pull from the remote 'xxx', but did not specify a branch.
借实验楼的github用一下!$git remote add xxx git@github.com:shiyanlou-001/shiyanlou-001.git$git pull xxx提示如下:You asked to pull from the remote 'xxx', but did not specifya branch. Because this is not the d...原创 2019-12-28 21:04:47 · 14410 阅读 · 2 评论 -
fork与pull的区别
fork是在GitHub仓库网站进行的操作,复制某人Github仓库内容到自己在GitHub上的仓库中,带有提交历史。另外将自己的修改(pull request)发给作者,由作者决定是否接受。这个修改可以由自己fork的Github仓库pull到本地电脑上来完成。pull是由Github仓库网站复制到本地电脑,带有提交历史。修改后不能向原作者出pull request。原创 2019-12-28 19:53:31 · 1015 阅读 · 0 评论 -
git clone与pull的区别
git clone过来没有分支版本记录,git branch会提示没有任务分支,也不能进行git reset、git log等操作。git pull过来的带有分支版本记录,可以git reset和git log等操作。一句话,clone过来不带历史,pull过来带历史。...原创 2019-12-28 19:30:33 · 917 阅读 · 3 评论 -
解析git reset的三种模式
敲入git reset 相当于敲入git reset --mixed HEAD。除了mixed,还有hard soft,总共三种模式。hard模式使得三个区域一致。mixed模式作用到后两个区域,staged snapshot和commit history。soft模式仅仅作用于最后一个区域,commit history。举个例子如果三个区域已经一致了,下面三种模式效果一样。$...原创 2019-12-28 12:56:50 · 726 阅读 · 0 评论 -
git FAQ:Not a valid object name: 'master'.
创建分支。$git branch ex1报错。fatal: Not a valid object name: 'master'.原因:没有master分支。解决方案:创建一个文件,并添加提交。$touch 1$git add 1$git commit -m '1'查看,master出现了。$git branch*master此时创建分支,不会报错了。...原创 2019-12-27 17:48:44 · 183 阅读 · 0 评论