git pull 没有指定branch报错的解决办法

如果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  

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

git branch --set-upstream-to=origin/ master

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

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

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

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

git branch --set-upstream master origin/master

然后运行:
git pull

你可能感兴趣的:(git)