当前位置:   article > 正文

git pull 没有指定branch报错的解决办法_if you wish to set tracking information for this b

if you wish to set tracking information for this branch you can do so with:

如果git pull 没有指定branch会出现如下错误:

$ git pull
Enter passphrase for key ‘/c/Users/Administrator/.ssh/id_rsa’:
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>
  • 1

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=origin/<branch> master
  • 1

这个时候有两种方法可以解决:

1. 在git pull 后面指定远程路径:

git pull git@github.com:远程仓库用户名/项目.git
  • 1

2. 先指定一下当前本地分支与远程仓库分支的链接关系:

git branch --set-upstream master origin/master
  • 1

然后运行:
git pull

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/392517
推荐阅读
相关标签
  

闽ICP备14008679号