Cherry pick set of commits from other branch skipping empty commits

后端 未结 2 1996
攒了一身酷
攒了一身酷 2021-01-20 22:34

I am doing merge bunches of commits using cherry-pick

git rev-list --reverse something-begin..something-end | git cherry-pick --stdin

相关标签:
2条回答
  • 2021-01-20 23:11

    Finally I found the solution.

    git rev-list --reverse something-begin..something-end . | git cherry-pick --stdin
    

    Adding a dot to rev-list command (that is the path parts) will skip all empty commits for me (what is --remove-empty for??)

    0 讨论(0)
  • 2021-01-20 23:11

    You can use rebase in this way (having your target branch checked out):

    git reset --hard something-end && git rebase ORIG_HEAD
    

    which automatically skips redundant commits.

    Credits go to my colleague Michael Adam, who came up with that idea.

    0 讨论(0)
提交回复
热议问题