相信有些人被困扰了很久,只是因为如下这一段提示:
git pull
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=<remote>/<branch> master
![7e26346b854c2b9991eb50928b7c3718.png](https://i-blog.csdnimg.cn/blog_migrate/ebf2466aabcb6767667d7b0c3b685684.jpeg)
然后网上就给出了一堆git -vv 查看本地分支和远程分支联系的方案。
![b30ae1485e5a2e841eaf30aa0dfd89a8.png](https://i-blog.csdnimg.cn/blog_migrate/b7c4c86043c4e6dde9ece22ee934d9a0.png)
得到的是这个令人懵逼的的结果,完蛋了,看不懂了,究竟哪个是本地,哪个是远程。
其实这么解释倒不如用如下这两个命令:
![d111e5190dd2c742bd1a151eb112f031.png](https://i-blog.csdnimg.cn/blog_migrate/db0f3179dda0807f7f59bbfe58ff655d.jpeg)
git branch -r 是远程,r也就是remote
git branch 不带r参数的,是本地
从结果也可以区分出来,带星号的是本地,不带星号的是远程。
而git branch -vv查看的其余内容其实没有用处在这个问题上,只会造成干扰