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