每当我向Gerrit提出新的更改/分支时:
git push origin HEAD:refs/for/82-blah
并拉回所有内容(带有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=<remote>/<branch> 82-blah
我不记得在推送到非Gerit Git存储库时看到过相同的消息。是不是Gerrit特定的东西,或者我缺少什么?
有什么办法可以避免此消息(钩吗?),所以我不必这样做:
git branch --set-upstream-to=origin/82-blah 82-blah
每次拉之前?
这不是Gerrit特有的。跟踪信息可以在repo配置文件-中找到.git/config
。如果在分支的特定部分添加了合并信息,则本地分支将进行远程跟踪:
[branch "82-blah"]
remote = origin
merge = refs/heads/82-blah
因此,我认为您的配置中缺少此信息。您是如何创建问题的本地分支的。如果使用,git checkout -b <branch>
则不会将任何跟踪信息添加到该本地分支机构。最好使用git checkout -b <branch> origin/<branch>
或git checkout <branch>
。使用这些命令,默认情况下将添加跟踪信息。(使用--no-track
switvh可以跳过)。您也可以随时定义跟踪信息git config <branch>.remote origin and git config <branch>.merge refs/heads/<branch>
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句