I have two branches. Say, the first one commit's checksum is 11223344, the second one has 55667788. How to assign the commit 55667788 to the first branch?
Asked
Active
Viewed 665 times
2
-
You want to apply the changes of the commit of one branch to the other? – jdi Nov 28 '12 at 06:07
-
1What do you want? Just merge the second branch into the first branch? – Arjan Nov 28 '12 at 06:08
-
@Arjan, I made it. But I'm bad at git now and don't know what `cherry-pick` means. – Maksim Dmitriev Nov 28 '12 at 06:26
1 Answers
3
If you simply want to apply the changes in commit 55667788
to branch first
, you can just use cherry-pick
.
git checkout first
git cherry-pick 55667788
If you are actually after importing all commits that second
has that first
doesn't (including 55667788
) you would merge it.
git checkout first
git merge --no-ff second
The --no-ff
argument is made clear here
(From nvie.com, Vincent Driessen, post "A successful Git branching model")

Pablo Fernandez heelhook
- 11,985
- 3
- 21
- 20
-
@RedPlanet beware of cherry-pick dangers: http://stackoverflow.com/questions/13522664/what-does-cherry-pick-do-exactly-in-git/13524494#13524494 – VonC Nov 28 '12 at 07:09