Seth Johnson Seth Johnson - 1 year ago 86
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.

Answer Source

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download