本文介绍了Git mergetool生成不需要的.orig文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用Kdiff3(以及其他合并工具)尝试合并冲突解决方案时,我注意到在分辨率上创建了一个 *。orig 文件。有没有办法让它不创建额外的文件?

When I do a merge conflict resolution with Kdiff3 (and other merge tool I tried) I noticed that on resolution a *.orig file is created. Is there a way for it to not create that extra file?

推荐答案



A possible solution from git config:

git config --global mergetool.keepBackup false



另一种方法是不添加或忽略这些文件,如,

The alternative being not adding or ignoring those files, as suggested in this gitguru article,

建议中使用:

Berik suggests in the comments to use:

find . -name \*.orig
find . -name \*.orig -delete

建议在,以了解内部差异工具设置,这些设置也可以生成这些备份文件,无论这些备份文件是什么。

Charles Bailey advises in his answer to be aware of internal diff tool settings which could also generate those backup files, no matter what git settings are.


  • kdiff3有其自己的设置(请参阅在其手册中)。

  • 其他工具如WinMerge可以有自己的备份文件扩展名(WinMerge: .bak ,如)。

  • kdiff3 has its own settings (see "Directory merge" in its manual).
  • other tools like WinMerge can have their own backup file extension (WinMerge: .bak, as mentioned in its manual).

所以你也需要重置这些设置。

So you need to reset those settings as well.

这篇关于Git mergetool生成不需要的.orig文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 09:51