2

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?

Maksim Dmitriev
  • 5,985
  • 12
  • 73
  • 138

1 Answers1

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

alt text
(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