简体   繁体   中英

Git merge --no-ff and submodules

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM