背景
最近在使用repo sync同步代码时老是报告:branch xxx is published (but not merged) and is now 1 commits behind。我之前是由推送过一笔提交,但是最后由于某种原因,我在Gerrit上Abandoned掉了这笔提交。
当时就觉得这和本地仓库可能有某种关联,只不过没有去细究,而是手动进行了rebase。
最后在.repo/repo/project.py
中找到了相关信息:
upstream_gain = self._revlist(not_rev(HEAD), revid)
pub = self.WasPublished(branch.name, all_refs)
if pub:
not_merged = self._revlist(not_rev(revid), pub)
if not_merged:
if upstream_gain:
# The user has published this branch and some of those
# commits are not yet merged upstream. We do not want
# to rewrite the published commits so we punt.
#
syncbuf.fail(self,
"branch %s is published (but not merged) and is now %d commits behind"
% (branch.name, len(upstream_gain)))
return
当即恍然大悟,果然在对应的的.git/refs
发现了一个published
的链接文件,这个文件链接到repo项目下对应的仓库,查看其内容:里面记录了我在Gerrit上Abandoned掉的这笔提交。删除这个文件,在进行repo sync,顺利进行!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)