Reputation: 414
There are a few answers about getting the most recent commit for a file. The answers boil down to "git log --all --pretty=format:%H -- path."
Note the --all to search the whole graph.
git log is very slow. It seems to take a few seconds per operation which is painful when you've got thousands of files to look at. Is there a faster plumbing way to do this?
Upvotes: 0
Views: 112
Reputation: 3739
You can use this command. This works very fast for me on a large repository that I work on (million lines of code with history going back 10 years).
git log -n 1 -- filename
-n 1
gives you the most recent commit-- filename
narrows down git log to just the filename that you wantUpvotes: 1