4

Using Git, how can I find the newest file?

Note this is not the same as the most recently changed file, but the commit that most recently introduced a file.

Zombo
  • 1
  • 62
  • 391
  • 407
  • It's not exactly what you are looking for, but ``whatchanged`` will give you files changed in the last commit [source](http://superuser.com/a/117652) – Nick Tomlin May 30 '14 at 03:48

1 Answers1

1
git log --diff-filter=A

This reveals commits that introduced a file. It can be modified to show only the last commit that introduced a file

git log --diff-filter=A -1

or printing the diff of that file

git log --diff-filter=A -p

or just the stat

git log --diff-filter=A --stat

Example

Community
  • 1
  • 1
Zombo
  • 1
  • 62
  • 391
  • 407
  • 1
    Note that whether a file is "renamed" or "added" is sometimes a question of flags (-M arguments). @vcsjones: same here. :-) – torek May 30 '14 at 03:57