每次我使用git-review结帐到审查分支时,如下所示:
j ❯❯❯ git-review -d 5779
Downloading refs/changes/79/5779/1 from gerrit
Switched to branch "review/jezor/5779"status命令告诉我,我领先于gerrit/master分支:
j ❯❯❯ git status
On branch review/jezor/5779
Your branch is ahead of 'gerrit/master' by 364 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean因此,我向gerrit/master分公司退房:
j ❯❯❯ git checkout gerrit/master
Note: checking out 'gerrit/master'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at cb563f2e... Old, old commit from six months ago然后尝试将当前的主程序重新定位,并对其进行新的更改:
j ❯❯❯ git pull --rebase origin master
From ssh://my.projects.review:29418/some_project
* branch master -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Fast-forwarded HEAD to dcf5ac6807455dcca33e288d830515c6bfe89aa0.
j ❯❯❯ git push origin HEAD:gerrit/master
error: unable to push to unqualified destination: gerrit/master
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'ssh://jezor@my.projects.review:29418/some_project'..。如你所见,没有成功。
这对我和我的团队没什么影响,因为我们已经习惯了。尽管如此,保持存储库的干净还是很好的。我猜想这条线在git-review脚本中应该对此行为负责(将上游设置为gerrit/master而不是master)。
为什么这支树枝离我们这么远?
我能以某种方式更新它吗?
否则,我能完全摆脱它吗?
发布于 2017-03-22 11:18:45
首先,让我们澄清“主人”和“格瑞特/主人”两种术语的区别:
要检查的事情:
https://stackoverflow.com/questions/42940188
复制相似问题