我有一个远程裸存储库hub
。我只在master
分支。
下面这个错误消息的最后一句话让我想知道:我如何找出哪个是“当前分支的默认配置远程”?我该如何设置它?
[myserver]~/progs $ git remote -v
hub ~/sitehub/progs.git/ (fetch)
hub ~/sitehub/progs.git/ (push)
[myserver]~/progs $ git branch -r
hub/master
[myserver]~/progs $ cat .git/HEAD
ref: refs/heads/master
[myserver]~/progs $ git pull hub
You asked to pull from the remote 'hub', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
您可以做得更简单,保证您的.gitconfig
处于有意义的状态:
使用Git版本v1.8.0及以上
git push -u hub master
当推动时,或者:
git branch -u hub/master
OR
(这会将遥控器设置为当前已签出的分支 to hub/master
)
git branch --set-upstream-to hub/master
OR
(这将为名为的分支设置远程branch_name
to hub/master
)
git branch branch_name --set-upstream-to hub/master
如果您正在使用v1.7.x
或更早
你必须使用--set-upstream
:
git branch --set-upstream master hub/master
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)