Git remove duplicate commits

前端 未结 3 712
耶瑟儿~
耶瑟儿~ 2021-01-13 21:05

After some playing with remotes I ended up with all my commits being doubled. E.g. instead of

C3107
..
C3
C2
C1

I got

C31         


        
3条回答
  •  鱼传尺愫
    2021-01-13 21:45

    With a bit of shell magic, grepping and a lot of confidence, then the answer is probably "yes". But I'd be too leery of completely messing things up to squash over 3000 commits with a single command!

    However, you can do it (moderately) interactively by using interactive rebasing. It's a bit laborious, but you have good control over what's happening and you get good feedback from git.

提交回复
热议问题