How can I skip commits in git?

后端 未结 3 1889
执念已碎
执念已碎 2021-01-04 04:46

I have some commits that I don\'t want in my project, but there\'s a commit based on them which I do want in it. This is my GitHub \"Network\" graph of the repository (ASCII

3条回答
  •  日久生厌
    2021-01-04 05:53

    I can give you two options:

    • Interactive rebase (git rebase -i) presents you a list of commits, editing this list will change the result of the operation; lets you reorder, delete or tag these commits for miscellaneous operations. In your case, you can rebase [*]'s branch into [_]'s and delete the lines unwanted commits.

    • Cherrypick lets you apply the changes of a single commit into another branch. In your case, you can simply cherrypick commit [*] into [_]'s branch.

提交回复
热议问题