Show All Commits For A File Beyond Renaming
By including -- <filename>
with a git log
command, we can list all the commits for a file. The following is an example of such a command with some formatting and file names.
What we may not realize, though, is that we are missing out on a commit in this file's history. At one point, this file was renamed. The command above wasn't able to capture that.
Using the --follow
flag with a file name, we can list all commits for a file beyond renaming.
This command roped in a commit from when README.md
used to be called README.rdoc
. If you want to know about the full history of a file, this is the way to go.
Last updated