<div class="iteye-blog-content-contain" style="font-size: 14px"></div>
2.You are not currently on a branch.
症状:有一次pull的时候又出现冲突,这回用“git reset --hard FETCH_HEAD”方法都不行了,出现:
$ git pull
You are not currently on a branch, so I cannot use any
'branch.<branchname>.merge' in your configuration file.
Please specify which remote branch you want to use on the command
line and try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
解决方法:
首先git checkout -b temp
其次git checkout master
即可恢复到master repository的状态,然后就可以pull了
2.You are not currently on a branch.
症状:有一次pull的时候又出现冲突,这回用“git reset --hard FETCH_HEAD”方法都不行了,出现:
$ git pull
You are not currently on a branch, so I cannot use any
'branch.<branchname>.merge' in your configuration file.
Please specify which remote branch you want to use on the command
line and try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
解决方法:
首先git checkout -b temp
其次git checkout master
即可恢复到master repository的状态,然后就可以pull了
本文介绍了一种在Git中遇到非分支状态时无法使用'git pull'命令的问题及解决方案。当尝试从远程仓库拉取代码时,可能会遇到提示您不在任何分支上的错误消息。文章提供了一个两步解决方案:首先创建并切换到临时分支,然后回到master分支进行正常的代码拉取。
3137

被折叠的 条评论
为什么被折叠?



