You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Git merge的--rerere-autoupdate选项默认行为及配置问询

Git Merge中rerere-autoupdate的默认行为与配置

默认行为

执行git merge且未指定--rerere-autoupdate或--no-rerere-autoupdate时,默认行为等价于启用--rerere-autoupdate。也就是说,当rerere机制复用已记录的冲突解决方案更新工作树文件后,会自动将解决方案的结果同步更新至索引,无需手动执行git add暂存这些文件。

配置选项

该默认行为支持通过Git配置修改,对应配置项为rerere.autoupdate:

  • 若想将默认行为改为--no-rerere-autoupdate,可执行命令:
    # 全局生效
    git config --global rerere.autoupdate false
    # 仅当前仓库生效
    git config rerere.autoupdate false
    
  • 要恢复默认的自动更新索引行为,执行:
    git config --global rerere.autoupdate true
    

补充说明

启用--no-rerere-autoupdate(或配置为false)时,rerere仅更新工作树文件,不会自动暂存到索引。你可以先检查冲突解决结果,确认无误后再手动执行git add,以此提前发现潜在的错误合并。

内容的提问来源于stack exchange,提问作者bern

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 22:44:51