2012年4月16日 星期一

[Git] cherry-pick



If you create a new branch which has five commits as fig. 1, and you'd like to merge D and F only into master as fig. 2.

A-B                             master
       \
        C-D-E-F-G         branch1
            <fig. 1>


A-B-D-F                     master
               \
                C-E-G         branch1
            <fig. 2>


All you have to do is....
$ git checkout master
$ git cherry-pick D
$ git cherry-pick F
$ git checkout branch1
$ git rebase master






Reference:
http://blog.luzi82.com/2010/08/git-cherry-pick-rebase.html

沒有留言:

張貼留言