Files
Advanced-Git/contents/show-commit-history-of-a-specific-file.md
2025-07-26 07:49:48 +00:00

953 B

⬅️ Back to Past commits of a specific file

Show Commit History of a Specific File

Category: History

Command

git log --oneline -- filename.txt

Examples

  • List all commits that modified filename.txt.
git log --oneline -- filename.txt 
  • Show commit history for a different file.
git log --oneline -- path/to/anotherfile.js 

Steps

  1. Lists all commits that modified filename.txt.
  • git log -p -- filename.txt
  • git blame filename.txt

➡️ See the Next Step: Show Detailed Commit History (With Changes)


Author: mike-rambil • Updated: 2024-06-10 • Tags: log, file, history