最近使用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在本地新建一個分支后,需要做遠(yuǎn)程分支關(guān)聯(lián)磅叛。如果沒有關(guān)聯(lián),git會在下面的操作中提示你顯示的添加關(guān)聯(lián)萨赁。
關(guān)聯(lián)目的是在執(zhí)行g(shù)it pull, git push操作時就不需要指定對應(yīng)的遠(yuǎn)程分支宪躯,你只要沒有顯示指定,git pull的時候位迂,就會提示你访雪。
解決方法就是按照提示添加一下唄:
git branch --set-upstream-to=origin/remote_branch your_branch
其中,origin/remote_branch是你本地分支對應(yīng)的遠(yuǎn)程分支掂林;your_branch是你當(dāng)前的本地分支臣缀。