Skip to content

Instantly share code, notes, and snippets.

@canton7
Created June 14, 2013 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canton7/5780755 to your computer and use it in GitHub Desktop.
Save canton7/5780755 to your computer and use it in GitHub Desktop.
Finding files deleted by evil merges
The following snippet might help detect evil merges which deleted a file.
$ for rev in `git rev-list --merges HEAD`; do del=`( git diff --name-only --diff-filter=D $rev^ $rev; git diff --name-only --diff-filter=D $rev^2 $rev ) | sort | uniq -u | tr '\n' ' '`; [ -n "$del" ] && echo "$rev $del"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment