赞
踩
目录
执行 git pull 遇到如下报错提示:
There is no tracking information for the current branch. Please specify which branch you want to merge with.
具体过程如下:
$ git pull
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 13 (delta 5), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (13/13), done.
From git.baijiashilian.com:client/brtc/google/webrtc
588a9c3..d1556ac lozen/dll -> origin/lozen/dll
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> lozen/dll
截图如下:
在拉取代码时,可以明确指定远程仓库名和分支名,规则如下:
git pull <remote> <branch>
命令实例:
git pull origin lozen/dll
但是,这样有一个问题,就是每次执行 git pull 命令时都需要指明仓库和分支。
另外一种解决方法就是关联本地仓库分支和远程仓库分支,规则如下:
git branch --set-upstream-to=origin/ lozen/dll
命令实例:
git branch --set-upstream-to=origin/lozen/dll lozen/dll
执行过程如下图所示:
这样以后就可以像之前一样只输入 git pull 同步代码了。
这种方法也是终极大法,重新 git clone 即可。
哈哈,是不是调皮了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。