How-to: Git clean up .orig files generated after conflict resolution
This works even if .orig has been added to .gitignore. Works for any files matching a regular expression.
After a merge conflict resolution you're often left with files ending
.orig extension. I have them added to my global
Hence I can't easily get rid of them with regular:
git clean -fd.
git clean has
-e argument for a regular expression to match files.
To preview what will happen:
git clean -e '!*.orig' --dry-run
To actually delete the files:
git clean -e '!*.orig' -f
It's that simple.