在想拉取最新的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