Git merge --no-ff 和子模块
我在 Windows XP SP3 上使用 msysGit 1.7.6。
我有一个带有 2 个跟踪分支(让我们称它们为 b1 和 b2 -> b1)和一个子模块(让我们称其为 sub)的项目。
从b1创建b2后,我检查了b1中sub的另一个修订版,然后使用--no-ff将b1合并到b2中。
现在,b2 有一个奇怪的行为。 “git submodule update”不执行任何操作。如果我运行“git log”,我可以看到结账,但如果我运行“git log sub”,我就看不到它。
我尝试在 sub 中使用“git checkout”查看后来的修订版,但它被视为来自 HEAD 的更改。检查后,运行 'git diff HEAD' 显示有差异,'git diff HEAD^1' 也显示差异,但 'git diff HEAD^2' 显示没有差异!
我做错了什么?这是一个错误吗?
I'm using msysGit 1.7.6 on Windows XP SP3.
I have a project with 2 tracking branches (let's call them b1 and b2 -> b1) and a submodule (let's call it sub).
After creating b2 from b1, I checked out another revision of sub in b1, and then merged b1 into b2 with --no-ff.
Now, b2 has a strange behavior. 'git submodule update' doesn't do anything. If I run 'git log' I can see the checkout, but if I run 'git log sub' I don't see it.
I tried checking out the later revision using 'git checkout' in sub, but it is treated like a change from HEAD. After checking it out, running 'git diff HEAD' shows there is a difference, 'git diff HEAD^1' also shows the difference, but 'git diff HEAD^2' shows there is NO difference!
What am I doing wrong? Is this a bug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,这是我的错......合并显然失败了,但我没有注意到它(它是更大脚本的一部分)。
只需将 -X 他们的添加到合并中即可。现在可以了。
Ok, it was my fault... The merge apparently failed, but I didn't notice it (it's part of a larger script).
Just needed to add -X theirs to the merge. Now it works.