git pull提示You are not currently on a branch. Please specify which


  在想拉取最新的git代码时提示要输入远端分支。具体提示见以下:

[root@cn-hxh-ope gamecode]# git pull

You are not currently on a branch. Please specify which
branch you want to merge with. See git-pull(1) for details.
 
    git pull <remote> <branch>

  

  这里的原因是因为不在master分支,在tag或者其它分支上。使用git branch查看,目前在一个tag上。

  这里解决方式有2种。

1.查看所有变化的文件,把有改动的先删除。
git status
2.切回master主分支
git checkout master
3.更新最新的代码
git pull
4.切回之前使用的tag/分支
git checkout dev

  或者更简单的方式,直接指定分支或者同步的tag名称

git pull origin 1.21.20200820170006_1.21.20200826143407


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM