Seth Johnson Seth Johnson - 4 months ago 35
Git Question

Finding the date/time a file was first added to a Git repository

Is there a simple Git command to determine the "creation date" of a file in a repository, i.e. the date it was first added?

It would be best if it can determine this even through file renames/moves. I'd like it to be a computer-readable one-line output; it may be that I haven't figured out the correct

git log <fname>
options to do this.


git log --format=%aD <FILE> | tail -1

With this command you can out all date about this file and extract the last