Skip to content

Instantly share code, notes, and snippets.

@zigarn
Created October 2, 2014 14:46
Show Gist options
  • Save zigarn/4270d18151ac99f38f99 to your computer and use it in GitHub Desktop.
Save zigarn/4270d18151ac99f38f99 to your computer and use it in GitHub Desktop.
git ls-tree -r HEAD^{tree} \ # list files
| grep -v '^120000 ' \ # ignore symlinks
| cut -d " " -f 3- \ # remove columns 1 and 2 (mode and type)
| sort -k1 -k2 \ # sort
| awk 'BEGIN { FS = " " } { count[$1]++; if (count[$1] == 1) {first[$1] = $0;}; if (count[$1] == 2) {print "-"; print first[$1];}; if (count[$1] > 1) {print} }' # list duplicates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment