用 rerere 复用冲突解决方案

记录冲突的解决方式并在下次自动应用。

macOS自动化Git命令行低风险
运行 git config rerere.enabled true,开始记录并重放解决方案。

01命令

命令
$ git config rerere.enabled true

02作用说明

反复变基时同样的冲突会再次出现;rerere 会记住解决方式并在下次自动应用,节省大量手工劳动,是终端工作流中自然的自动化特性。

03风险

风险低风险
使用条件Git 2.20+ (install with Homebrew or Xcode Command Line Tools)
系统兼容性macOS with Git installed (Homebrew or Xcode Command Line Tools)
!注意: 上下文变化时自动解决可能出错;提交前请审查重放的代码块。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • git-rerere documentation
    Git · vendor-doc · 2026-09-20
    依据: Documents rerere, which records conflict resolutions and reuses them.

最后验证: 2026-10-13 · 分类: 开发者