Ignoring or skipping certain commits on Git

This question already has an answer here:

  • Delete commits from a branch in Git 23 answers
  • Undo a particular commit in Git that's been pushed to remote repos 3 answers

  • You can run git rebase -i hash_to_your_7th_commit and delete commits 8 and 10 but you are most likely going to get lots of conflicts.

    Another option is git checkout -b 7th_commit and cherry-pick commits 9 and from 10 to 15. Keep in mind that if you give a range 10..15 cherry-pick will start at 11.

    I would recommend though to just revert these two commits because you may change your mind about pushing it someday.

    链接地址: http://www.djcxy.com/p/9014.html

    上一篇: 如何删除推送提交并恢复到旧提交?

    下一篇: 忽略或跳过Git上的某些提交