Cherry pick set of commits from other branch skipping empty commits

后端 未结 2 2004
攒了一身酷
攒了一身酷 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

    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.

提交回复
热议问题