git rerere 是否自动将文件标记为已解决? [英] Have git rerere automatically mark files as resolved?
问题描述
我正在使用 git rerere,它很有用,但有一个问题:当它自动解析文件时,它不会将其标记为已解决(例如使用 git add).因此,如果我运行git mergetool",它会打开文件,就好像它仍然包含所有冲突一样.
到目前为止,我已经制作了一个可以调用的小 shell 脚本,它会扫描所有标记为冲突的文件以查找冲突标记(例如 >>>>>>>
),如果没有,则调用 git-add .
有没有更好的方法来做到这一点?我错过了一些 git rerere 的标志?
也许是 git config
设置可以帮助:
rerere.autoupdate
<块引用>
当设置为 true 时,git-rerere
在使用先前记录的解决方案干净地解决冲突后,用结果内容更新索引.
默认为 false.
注意:从 Git1.7.0 开始,
<块引用>"git rerere
" 有 rerere.autoupdate
配置,但无法从命令行取消它;
为merge
"、revert
"等提供的 --no-rerere-autoupdate
选项修复了这个问题.
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
" hadrerere.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屋!