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.

1
  • It's not exactly what you are looking for, but whatchanged will give you files changed in the last commit source Commented May 30, 2014 at 3:48

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Note that whether a file is "renamed" or "added" is sometimes a question of flags (-M arguments). @vcsjones: same here. :-)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.