让git rerere自动将文件标记为已解决? [英] Have git rerere automatically mark files as resolved?

查看:176
本文介绍了让git rerere自动将文件标记为已解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用git rerere,它很有用,但有一个问题:当它自动解析文件时,它不会将其标记为已解析(例如,使用git add)。所以如果我运行'git mergetool',它会打开文件,就好像它仍然存在所有的冲突。

到目前为止,我已经创建了一个可以调用的小型shell脚本,它可以扫描标记为冲突标记冲突的所有文件(例如> ;>>>>>>< / code>),并且在它们没有的时候调用它们。

有没有更好的方法来做到这一点?一些标志git rerere我错过了?

解决方案

也许一个 git config 设置可以提供帮助:

  rerere.autoupdate 




设置为true时, git-rerere 在使用先前记录的分辨率彻底解决冲突后,使用结果内容更新索引。

默认为false。

注意:既然Git1.7.0,


git rerere had rerere.autoupdate 配置,但没有办法从命令行对其进行反制;

- no-rerere-autoupdate 赋予 merge revert 等修正了这个问题。



I'm using git rerere, and it is useful, but there is one problem: When it automatically resolves a file, it does not mark it as resolved (eg with git add). So if I run 'git mergetool', it opens up the file as if it still has all the conflicts in it.

So far, I've made a small shell script which I can call, which scans all files marked as conflicted for conflict markers (eg >>>>>>>), and calls git-add on them if they have none.

Is there a better way of doing this? Some flag to git rerere I missed?

解决方案

Maybe a git config setting can help:

rerere.autoupdate

When set to true, git-rerere updates the index with the resulting contents after it cleanly resolves conflicts using previously recorded resolution.
Defaults to false.

Note: since Git1.7.0,

"git rerere" had rerere.autoupdate configuration but there was no way to countermand it from the command line;
--no-rerere-autoupdate option given to "merge", "revert", etc. fixes this.

这篇关于让git rerere自动将文件标记为已解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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