最近使用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=origin/<branch> release
其實,輸出的提示信息說的還是比較明白的。
使用git在本地新建一個分支后,需要做遠程分支關聯。如果沒有關聯,git會在下面的操作中提示你顯示的添加關聯。
關聯目的是在執行git pull, git push操作時就不需要指定對應的遠程分支,你只要沒有顯示指定,git pull的時候,就會提示你。
解決方法就是按照提示添加一下唄:
git branch --set-upstream-to=origin/remote_branch your_branch
其中,origin/remote_branch是你本地分支對應的遠程分支;your_branch是你當前的本地分支。