git merge after git cherry-pick?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Still being a newbie...

On a branch, b, made off of master, I've made the commits b1, b2, b3 and b4.

Back on master, I need commit b1 and b3 immediately. So I:

$ git checkout master
$ git cherry-pick "b1's SHA"
$ git cherry-pick "b3's SHA"

Now, both b and master contain b1 and b3. How do I now create a log of "what remains to be merged from b to master", i.e. only b2 and b4? And how do I merge b2 and b4 to master, so master's log shows b1, b3, b2 and b4 and doesn't show b1 and b3 twice, which is what I get if I:

$ git merge b

after the cherry-picks above. Also I noticed, that if I merge master into b (to keep up-to-date with master) b1 and b3 are also mentioned twice.

I did notice that cherry-pick created new SHA1 IDs for the commits for b1 and b3 on master (as indeed man cherry-pick also says). Maybe cherry-pick is not the right tool for the job. Is there another way to "copy"/"merge" only b1 and b3 (but not b2 and b4) from b into master maintaining merge history and avoiding them being mentioned twice later?

At the time of writing b1-b4, I did not know that b1 and b3 would be needed separately, so I didn't put (b1 and b3) and (b2 and b4) on separate branches. I did notice though, that they weren't an intricate part of "the new feature". Is it required that I then do the work in separate branches?

I hope this is possible as I'm thrilled with git!

Peter
--
Peter Valdemar Mørch
http://www.morch.com
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux