今天提交代码,提示被拒,同事帮忙排查问题,一顿操作后成功解决。
【场景】
提示以下信息:
git branch --set-upstream-to=origin/feature-liui feature-liuiThere is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> feature-xxxx
意思就是,本地的分支和远程分支没关联,git pull或git push操作时需要指定对应分支。
按照最后一行输入命令关联就行。
【命令】
git branch --set-upstream-to=origin/远程分支名称 本地分支名称
场景
解决后操作成功