根据主分支重新建立分离的 HEAD
我在工作中使用 gerrit,它需要使用 rebase 而不是合并提交。今天,我使用其哈希值检查了之前的提交,当我运行 gitbranch 命令时,我被告知我处于“无分支”状态。我认为这是一个独立的头?无论如何,我根据我的主分支进行了重新调整,控制台打印出
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
这种情况下的“3路合并”来自哪里?变基后 HEAD 是否仍然分离(考虑“base-tree”语句)?谢谢。
I use gerrit at my job, and it requires use of rebase instead of merge commits. Today I checked out a previous commit using its hash value, and when I ran the git branch command, I was informed I was on "no branch". I assume this is a detached HEAD? In any case, I rebased against my my master branch, and the console printed
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Where does the '3-way merge' in this situation come from? And was the HEAD still detached after the rebase (considering the 'base-tree' statement)? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,“无分支”意味着分离的 HEAD
基本修订来自于执行
它将查看最后一个共同祖先(或合并点,即使存在手动冲突,也被认为是共同祖先)来建立一个基础版本。
变基后,您通常始终位于新的分离头 IIRC 上。现在有多种方法可以调用 rebase(包括 --onto --root),并且它们的行为可能略有不同。因此,如果您愿意发布所使用的 rebase 命令,我可能会验证我的想法,并可能添加一些评论。
Yes 'no branch' means detached HEAD
The base revision comes from doing
It will look at the last common ancestor (or merge point, which is considered a common ancestor even if there were manual conflicts) to establish a base version.
After a rebase, you are normally always on a new detached HEAD, IIRC. Now there are numerous ways in which to call rebase (including --onto --root) and they may behave slightly differently. So if you care to post the rebase command used, I may verify my thinking and perhaps add some comments.
正如此处所示所示,此错误消息通常是冲突的迹象:
关键是修复后继续 rebase冲突。
As illustrated here, this error message is usually the sign of a conflict:
The key is to continue the rebase after fixing the conflict.