开发者

Git how to removed selected commit from tree? [duplicate]

开发者 https://www.devze.com 2023-01-27 04:30 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Git: removing selected commits from repository
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Git: removing selected commits from repository

I'd like to remove selected 开发者_JS百科commmit from linear commit tree:

R->A->B->C->D->HEAD

I want to remove commit C and all changes which made in it.


You can do this using an interactive rebase operation. There's a good description of how it works in that link.

Essentially, you will rewrite commits so that instead of

R->A->B->C->D->HEAD

you have

R->A->B->D'->HEAD'

D' is related to D in that it introduces the same change, but is based on B instead of C. Note that if D introduces changes that depend on C, you may have a conflict you need to resolve.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号