Skip to content

Instantly share code, notes, and snippets.

@ponsuke0531
Created September 3, 2017 07:41
Show Gist options
  • Save ponsuke0531/df753e371fdf5c2abb9dd99c3dfd972d to your computer and use it in GitHub Desktop.
Save ponsuke0531/df753e371fdf5c2abb9dd99c3dfd972d to your computer and use it in GitHub Desktop.
Gitで何回もコミットとマージをしたブランチをコミットだけをチェリーピックしてブランチ造り直す方法 ref: http://qiita.com/ponsuke0531/items/075ee81e2ca489f7ba15
$ git checkout branchA
$ git log --pretty=onelinere
7c4a... {Commitコメント1}
c037... Merge branch 'master' of ....
3bb5... {Commitコメント2}
...<省略>...
$ git log 1201...
commit 1201...
Author: xxxxxx
Date: Sun Apr 16 17:32:17 2017 +0900
{Commitコメント}
$ git log --pretty=onelinere --after='2017-04-16 17:32:00' > cherry-pick.csv
$ git checkout branchD
$ git checkout -b branchC
$ git cherry-pick 1201...
$ git cherry-pick 8bf1...
$ git cherry-pick d5c8...
$ git cherry-pick c2b9...
...<省略>...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment