在git pull时 报错 There is no tracking information for the current branch. Please

227 阅读1分钟

场景:

在git pull时 报错

There is no tracking information for the current branch. Please specify which branch you want to merge with.

image.png

原因:

本地分支还没和远程分支分支之间建立链接关系


解决办法:

输入git branch --set-upstream-to=origin/<branch> master
此处前面一个是远程仓库的分支,后一个是本地分支。 image.png image.png 其中远程仓库的分支里的origin 释义:起源源头,是在添加远程仓库时设置的别名,可任意取,例如在vscode里设置的origin image.png image.png

最后查看本地分支是否和远程分支分支之间建立链接关系

git branch -vv