git reword而不再解决合并冲突 [英] git reword without resolving merge conflicts again

查看:285
本文介绍了git reword而不再解决合并冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用git rebase更改提交消息,但不必重新解决合并冲突?

我需要贬低一个较旧的回购,我不想更改任何实际的代码,只是消息。



我试过 - preserve-merges

解决方案

有一个名为重用记录分辨率的git鲜为人知的功能,或者是rerere。

您可以启用它全局通过运行 git config --global rerere.enabled 1



如果启用了rerere,git会自动保存冲突解决方案,如果遇到相同冲突,将在稍后重新使用这些解决方案。这最终导致不需要用户重新解决先前看到的冲突。



该功能在 git-scm.com上的帖子。有关更多详细信息,请参阅 git rerere的帮助文档


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.

解决方案

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 1.

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 further in a post on git-scm.com. For more detail, look at the help document for git rerere.

这篇关于git reword而不再解决合并冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆