git在本地新建一个分支,并切换到新建的分支执行git pull或git push 命令时可能会遇到下面的情况
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> dev
也可能会遇到 新建的分支与远程分支关联关联不对应的情况,如:
本地新建的dev分支,需要关联到远程的dev分支,却关联的是远程的test分支。
解决方案就是将本地分支与远程分支进行关联
git branch --set-upstream-to=origin/remote_branch your_branch
其中,remote_branch是你本地分支要对应的远程分支;your_branch是你当前的本地分支。