What command is used to list all commits that touched a specific file?
Posted by NickCrt
Last Updated: June 02, 2024
To list all commits that touched a specific file in a Git repository, you can use the following command:
git log -- <file_path>
Replace <file_path> with the path of the file you are interested in. This command will show you the commit history for that specific file, including details such as the commit hash, author, date, and commit message. If you want to see a more concise view, you might consider adding additional flags, such as:
git log --oneline -- <file_path>
This will display the commit history in a one-line summary format for each commit related to that file.
Related Content
What command reverts a specific commit?
What command reverts a specific commit?
DavidLee | Jul 07, 2024