欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

Git Error:There is no tracking information for the current branch.

程序员文章站 2022-06-29 21:34:10
在执行git pull的时候,提示当前branch没有跟踪信息: $> git pull There is no tracking information for the current branch. Please specify which branch you want to merge w... ......

在执行git pull的时候,提示当前branch没有跟踪信息:

$> 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> localdev

对于这种情况有两种解决办法,就比如说要操作 localdev 吧,一种是直接指定远程 master(localdev 是当前本地分支,master 是远程主分支):

git pull origin master 

另外一种方法就是先指定本地 localdev 到远程的 master ,然后再去pull(推荐方案):

$> git branch --set-upstream-to=origin/master localdev 
$> git pull

这样就不会再出现“there is no tracking information for the current branch”这样的提示了。

收工~