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?
An ORIG file is a file that may have been created by various programs. It stores a backup copy of a file, which has been renamed with the . orig extension so that the user knows it is the original. ORIG files are most often created manually by a user rather than by a program.
DESCRIPTION. Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge. If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without conflicts).
It's generally best to take that message and add any extra information rather than write your own from scratch. Developers who use git will automatically recognize git's merge commits but may not recognize your custom merge messages immediately.
git mergetool allows you to use a GUI merge program (i.e. Meld) to resolve the merge conflicts that have occurred during a merge. Like difftool you can set the GUI program on the command line using -t <tool> / --tool=<tool> but, as before, it makes more sense to configure it in your . gitconfig file.
A possible solution from git config
:
git config --global mergetool.keepBackup false
After performing a merge, the original file with conflict markers can be saved as a file with a
.orig
extension.
If this variable is set tofalse
then this file is not preserved.
Defaults totrue
(i.e. keep the backup files).
The alternative being not adding or ignoring those files, as suggested in this gitguru article,
git mergetool
saves the merge-conflict version of the file with a “.orig
” suffix.
Make sure to delete it before adding and committing the merge or add*.orig
to your.gitignore
.
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.
.bak
, as mentioned in its manual).So you need to reset those settings as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With