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.