What is the command to view the commit history of a file?
a)
git log filenameb)
git history filenamec)
git show-log filenamed)
git commit-log filenameAnswer:
a)
git log filenameExplanation:
The git log filename command shows the commit history of a specific file. It lists all commits that modified the file, allowing you to trace the evolution of that file through the project’s history.
This is useful for tracking changes made to a particular file, identifying when a bug was introduced, or understanding the file’s development history.
Using git log filename helps you analyze how and when specific changes were made to the file.