Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
607 views
in Technique[技术] by (71.8m points)

rebase - git reword without resolving merge conflicts again

Is it possible to change commit messages using git rebase, but without having to re-resolve merge conflicts?

I need to bowdlerize an older repo and I don't want to change any of the actual code, just the messages.

I've tried --preserve-merges.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There's a little-known feature of git called "Reuse Recorded Resolutions", or rerere.

You can enable it globally by running git config --global rerere.enabled true.

If rerere is enabled, git will automatically save conflict resolutions, and will reuse those resolutions later if it encounters the same conflicts. This has the net result of not requiring the user to re-resolve these previously seen conflicts.

The feature is explained here - Git - Rerere.

The documentation for git rerere command is here - git-rerere(1).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...