开发者

Git merge --no-ff and submodules

开发者 https://www.devze.com 2023-03-28 07:42 出处:网络
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).

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 revis开发者_Go百科ion 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号