共计 686 个字符,预计需要花费 2 分钟才能阅读完成。
有时创建 git 项目时候,经常会见到下方报错信息:
There 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> release
还有一种是:
$ git push
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push to the upstream branch
on the remote, use
git push origin HEAD:dev
To push to the branch of the same name on the remote, use
git push origin HEAD
To choose either option permanently, see push.default in 'git help config'.
解决办法
通常出现上述问题,都是因为本地和远程分支关联关系不正确导致的,解决办法也很简单,使用关联命令,指定本地和远程分支绑定即可:
git branch --set-upstream-to=origin/master dev
将本地 dev 分支关联到远程 master 分支。
正文完
加入官方交流QQ群:778957856