Skip to content

Instantly share code, notes, and snippets.

@terotil
Created November 20, 2014 13:20
Show Gist options
  • Save terotil/6a587de3c3c4bac30a56 to your computer and use it in GitHub Desktop.
Save terotil/6a587de3c3c4bac30a56 to your computer and use it in GitHub Desktop.

Git tip: Who added that file?

Find out who added a particular file and when by

git log --diff-filter=A -- a/file`

With terse sort friendly format --pretty="format:%ad %h %an" --date=short it is suitable for timelinig addition of several files

for f in files/*.js; do echo `git ... $f` $f; done | sort
@nikcorg
Copy link

nikcorg commented Nov 13, 2015

Very nice. I added this as an alias 'who' in my .gitconfig.

Works well together with find, e.g. find . -name "*.js" -print -exec git who {} \;

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