Skip to content

Instantly share code, notes, and snippets.

@seanbehan
Created January 12, 2012 16:42
Show Gist options
  • Save seanbehan/1601516 to your computer and use it in GitHub Desktop.
Save seanbehan/1601516 to your computer and use it in GitHub Desktop.
Recursively Delete .Orig Files After Failed Git Merge
# recursively delete original files after a git merge failure
find . -name *.orig -delete
@greveritt
Copy link

Well, seanbehan, that will delete ALL untracked files in that directory, not just .orig files.

@PriteshJain
Copy link

git clean -f */*.orig

or create a alias

git config alias.cleanall "clean -f */*.orig"

then just call

git cleanall

@ganeshjung
Copy link

recurse deeper: git clean -f */.orig

@radium-v
Copy link

radium-v commented Aug 8, 2014

We must go deeper

$ git clean -f ./**/*.orig

@masellfoodpanda
Copy link

Git clean is recursive. Just do:

git clean *.orig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment