Reputation: 60184
After I perform a Git merge and resolve the conflicts, there are leftover .orig versions of the conflicting files. How can I automatically delete those after the conflict is successfully resolved?
Upvotes: 41
Views: 6768
Reputation: 5984
Quite likely those files are created by KDiff3 tool you probably using for merging files. The easiest way to solve the problem is where it was originated:
Upvotes: 5
Reputation: 777
I think this should work:
git status -su | grep -e"\.orig$" | cut -f2 -d" " | xargs rm
See https://stackoverflow.com/a/10744524/670915 for details
Upvotes: 1
Reputation: 9
Even I was geting the same error, when I copy + paste the command from a word document. But I tried removing the --
before the switch global
and re-type it manually on the command prompt. It WORKED!
May be it was due to some mis-interpretation of the Charectes in the MS_Wrod and the Command Prompt.
Upvotes: -1
Reputation: 3431
It's the git mergetool that produces these files, you can disable them with this command:
git config --global mergetool.keepBackup false
See the git-config manpage:
http://man.he.net/man1/git-config
Upvotes: 54
Reputation: 4506
Git doesn't create *.orig files. It only marks the sections in the conflicting file with <<<< ... ==== ... >>>>
.
Which tool are you using? You'll have to disable it there.
But tools like WinMerge indeed create these files, but they automatically process and remove them when you mark the file as resolved within the editor.
Upvotes: 0