在开发中为了防止冲突,一般都会在本地新建分支,提交的顺序是
1.git add .
2.git commit -m “提交注释”
3.切换到远程分支,git merge 本地分支
这时远程分支可能还有别人提交的代码,本地如果要更新的话,
就要切回本地分支,pull ,但是会报这个错误
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
意思就是本地的仓库没有和远程仓库建立连接,‘这时我们输入以下指令
git branch --set-upstream-to=origin/远程分支 本地分支
再次pull,就能更新代码了