Re: Commit to more than one branch at once?

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

 



On Fri, 06 Oct 2006 20:18:42 +0200
Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx> wrote:

> if I git-cherry-pick a commit from branch A into branch B, this is shown
> as a difference in "git-log B..A".
> 
> Is it possible to commit a change to two or more branches but preserve
> the identity of the change? IOW, is there an alternative to
> git-cherry-pick that does not have above mentioned side effect?

Short answer:

No.

Slightly longer answer:

Only merging the branches will make the commit show up in branch B with
the same SHA1 number (or identity) that it had in branch A.  This is a
fundamental part of Git.  The sha1 of each commit is based in part on
the sha1 of its parent.  Thus it's impossible[1] to copy a commit to
another branch (ie. reparent it) without changing its identity.

Sean

[1]  Okay, more or less impossible.. don't ask me do the math.
-
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]