Remove merge artifacts in a git repository
Everyone does it at least once...you perform a git merge, hit some conflicts, and are left with .orig files. Here's a one-liner you can run from the root of your repo to delete those (and tell you which ones were deleted).
find . | grep -P 'orig$' ; find . | grep -P 'orig$' | xargs rm
I put this in my ~/.aliases file as rmorig.
alias rmorig="find . | grep -P 'orig$' ; find . | grep -P 'orig$' | xargs rm"
Written by Steve McHail
Related protips
1 Response
Could be simplified to:
find . -name \*.orig -exec rm {} \;
or in zsh:
rm */.orig
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#