What command displays the history of a file including changes?
Posted by EveClark
Last Updated: June 02, 2024
To display the history of a file including changes in a version control system like Git, you would use the following command:
git log <filename>
This command shows the commit history for the specified file, including details such as the commit hash, author, date, and commit message. If you want to see the actual changes made to the file in each commit, you can use:
git log -p <filename>
The -p option shows the differences (the "patch") introduced in each commit. Additionally, if you want to see a more simplified view of the history with just the commit messages and file changes, you can use:
git log --stat <filename>
Make sure you are in the directory of your Git repository when you run these commands.