For full path names of changed files:

git log --name-only

For full path names and status of changed files:

git log --name-status

For abbreviated pathnames and a diffstat of changed files:

git log --stat

There are a lot more options. Check out the documentation.

Answer from Lara Bailey on Stack Overflow
🌐
Git
git-scm.com › docs › git-log
Git - git-log Documentation
Output to a specific file instead of stdout. ... Specify the character used to indicate new, old or context lines in the generated patch. Normally they are +, - and ' ' respectively. ... For each commit, show a summary of changes using the raw diff format. See the "RAW OUTPUT FORMAT" section of git-diff[1]. This is different from showing the log itself in raw format, which you can achieve with --format=raw.
🌐
Git
git-scm.com › book › en › v2 › Git-Basics-Viewing-the-Commit-History
2.3 Git Basics - Viewing the Commit History
$ git log -p -2 commit ca82a6dff817ec66f44342007202690a93763949 Author: Scott Chacon <schacon@gee-mail.com> Date: Mon Mar 17 21:52:11 2008 -0700 Change version number diff --git a/Rakefile b/Rakefile index a874b73..8f94139 100644 --- a/Rakefile +++ b/Rakefile @@ -5,7 +5,7 @@ require 'rake/gempackagetask' spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "simplegit" - s.version = "0.1.0" + s.version = "0.1.1" s.author = "Scott Chacon" s.email = "schacon@gee-mail.com" s.summary = "A simple gem for using Git in Ruby code." commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7
🌐
Atlassian
atlassian.com › git › tutorials › git-log
Advanced Git Log | Atlassian Git Tutorial
January 12, 2026 - The git log command includes many options for displaying diffs with each commit. Two of the most common options are --stat and -p. The --stat option displays the number of insertions and deletions to each file altered by each commit (note that modifying a line is represented as 1 insertion ...
🌐
CraftQuest
craftquest.io › homepage › git version control › 6. git workflow tools › making sense of git log files
Making Sense of Git Log files - Git Version Control | CraftQuest
August 29, 2022 - Git logs allow you to review and read a history of everything that happened to a repository. The history is built using git-log, a simple tool with a ton…
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-check-git-logs
Git Logs - GeeksforGeeks
1 month ago - git log --after="2025-09-01" --before="2025-10-01" Helps track progress during specific development periods. Find commits with specific keywords in their message. ... Useful for locating when a specific feature or fix was introduced. Show the list of modified files in each commit.
Top answer
1 of 16
3111

This lets Git generate the patches for each log entry:

git log -p -- <filename>

-p in git generates patch text

See git help log for more options — it can actually do a lot of nice things. :)


To get just the diff for a specific commit, use

git show <revision> -- <filename>

or specify any other revision by identifier.


To browse the changes visually:

gitk -- <filename>

To see changes visually without leaving the console, run:

git blame-log <filename>

However, first ensure blame-log command exists, by at least once running:

# Virables: raw=unchanged-line, c=clean, B=Buffer,
git config --global alias.blame-log "! cd -- \"\${GIT_PREFIX:-.}\" && \
( if git grep -qI \".\" \"\$1\"; then \
    git log --oneline --color=always -L 1,\${2:-}:\"\$1\" | awk ' \
    { s=\$0; gsub(/\\033\\[[0-9;]*[mK]/, \"\", s) } \
    s~/^(diff|---|\\+\\+\+)/{next} \
    s~/^@@/{l=1;p=9;bi=0;cm=0;cp=0;next} s!~/^[-+ ]/{print;l=1;p=9;bi=0;cm=0;cp=0;next} \
    /^ /{ cm=0;cp=0; if(p<3){print;p++}else{b[bi%3]=\$0; bl[bi%3]=l; bi++} l++; next } \
    { if(p>=3){ n=(bi<3?bi:3); st=(bi<3?0:bi%3); print \"\\033[36mLine \"(n?bl[st]:l)\":\\033[m\"; for(k=0;k<n;k++)print b[(st+k)%3] } \
      p=0; if(s~/^-/){cm++;if(cm<=12)print;else if(cm==13)print\"...\"} else{cp++;if(cp<=12)print;else if(cp==13)print\"...\";l++} }'; \
else \
    echo \"Detected binary file, hence not showing lines-changed.\"
    git log --oneline --color=always \"\$1\";
fi ) | less -RX #"

Note that blame-log is intentionally limited to showing few lines per change-range, for example, to skip package-lock.json faster.

2 of 16
2730

For a graphical view, use gitk:

gitk [filename]

To follow the file across file renames:

gitk --follow [filename]

For a console view, maybe because you SSH into a head-less server, run:

git blame-log <filename>

However, first ensure blame-log command exists, by at least once running:

# Virables: raw=unchanged-line, c=clean, B=Buffer,
git config --global alias.blame-log "! cd -- \"\${GIT_PREFIX:-.}\" && \
( if git grep -qI \".\" \"\$1\"; then \
    git log --oneline --color=always -L 1,\${2:-}:\"\$1\" | awk ' \
    { s=\$0; gsub(/\\033\\[[0-9;]*[mK]/, \"\", s) } \
    s~/^(diff|---|\\+\\+\+)/{next} \
    s~/^@@/{l=1;p=9;bi=0;cm=0;cp=0;next} s!~/^[-+ ]/{print;l=1;p=9;bi=0;cm=0;cp=0;next} \
    /^ /{ cm=0;cp=0; if(p<3){print;p++}else{b[bi%3]=\$0; bl[bi%3]=l; bi++} l++; next } \
    { if(p>=3){ n=(bi<3?bi:3); st=(bi<3?0:bi%3); print \"\\033[36mLine \"(n?bl[st]:l)\":\\033[m\"; for(k=0;k<n;k++)print b[(st+k)%3] } \
      p=0; if(s~/^-/){cm++;if(cm<=12)print;else if(cm==13)print\"...\"} else{cp++;if(cp<=12)print;else if(cp==13)print\"...\";l++} }'; \
else \
    echo \"Detected binary file, hence not showing lines-changed.\"
    git log --oneline --color=always \"\$1\";
fi ) | less -RX #"

Note that blame-log is intentionally limited to showing few lines per change-range, for example, to skip package-lock.json faster.

🌐
Sentry
sentry.io › sentry answers › git › view the change history of a single file in git
View the change history of a single file in Git | Sentry
The --follow flag will include changes across renames in our change log. Note that --follow will only work if we’re looking at a single file – we should remove this flag if we’re viewing the history of multiple files, or want to exclude history past the file’s most recent renaming. The above git log command will output our file’s history as a series of diffs.
Find elsewhere
🌐
W3Schools
w3schools.com › git › git_history.asp
Git History
git log --since="2 weeks ago" commit 09f4acd3f8836b7f6fc44ad9e012f82faf861803 Author: w3schools-test · Date: Fri Mar 26 09:35:54 2021 +0100 Updated index.html with a new line · This command shows only the commits made in a recent time frame. See which files were changed in each commit and how many lines were added or removed:
🌐
GitHub
github.blog › home › open source › git’s database internals iii: file history queries
Git's database internals III: file history queries - The GitHub Blog
September 21, 2022 - If there is any chance that Git is skipping a commit that you know changed a file, then try to use --full-history with --simplify-merges. To demonstrate, I took the previous example repository and created a branch that improperly resolved a merge to ignore valid changes that already existed in the trunk. Look carefully at the difference between the two history modes: $ git log --graph --oneline -- src * 5637aa9 macos build: use runtime instead of osx-x64 * 7a99cc0 Fixes typo in Mac dist script $ git log --graph --oneline --full-history --simplify-merges -- src * 7da271b Update with latest trunk |\ | * 80423fa Merge pull request #800 from ...
🌐
DEV Community
dev.to › shehrozirfan › git-commands-to-get-information-about-changes-made-to-your-files-4ge9
Git commands to get information about changes made to your files - DEV Community
February 5, 2022 - It is the interesting command that shows the stats about commits such as how many files are changed and how many lines are added or removed. Lets see the output when using git log --stat:
🌐
Initial Commit
initialcommit.com › blog › git-log
git log | A Guide to Using the log Command in Git - Initial Commit
May 29, 2022 - It also provides a handy summary line that shows the total number of lines and files that were modified. This command is rather verbose, so let’s combine it with our previously mentioned filter that limits our log to that last two commits: $ git log --stat -2 commit a7d29889d47dfc5e6c8f91974039f91231269d95 (HEAD -> master) Author: Initial Commit LLC <Example@domain.com> Date: Tue May 24 13:40:55 2022 -0500 Added text to dir1file1.ext dir1/dir1file1.ext | 1 + 1 file changed, 1 insertion(+) commit 0a2012fc2461cfcededd2d00d99a4b1d96ce02f8 Author: Initial Commit LLC <Example@domain.com> Date: Tue May 24 13:40:15 2022 -0500 Added text to file2.ext file2.ext | 1 + 1 file changed, 1 insertion(+)
🌐
Linux Man Pages
linux.die.net › man › 1 › git-log
git-log(1): commit logs - Linux man page
$ git log -2 --pretty=tformat:%h 4da45bef $ git log -2 --pretty=%h 4da45bef · When "git-diff-index", "git-diff-tree", or "git-diff-files" are run with a -p option, "git diff" without the --raw option, or "git log" with the "-p" option, they do not produce the output described above; instead they produce a patch file.
🌐
W3docs
w3docs.com › learn-git › git-log.html
Git Log - How To Use Git Log | W3Docs Git Tutorial
'git log <file>' displays the history of changes made to a specific file.
🌐
Alvin Alexander
alvinalexander.com › git › show-commit-history-detailed-for-single-file
Git: View the (detailed) commit history for a single file | alvinalexander.com
September 14, 2022 - As an example, when I use that command on this file, I see several hundred lines of output that show me every line that has been added and removed from this file: $ git log -p --follow -- divLhsSkyAd.scala.html commit a00b98c051ec05f5f4675d004caba08037419e9d Author: Alvin Alexander ...
🌐
Team Treehouse
teamtreehouse.com › community › git-log-doesnt-show-file-name
git log doesn't show file name? (Example) | Treehouse Community
February 19, 2015 - For example, when I type git log, I get a list of the different commits made like "Made changes to x" or "Added y". Each commit comes with a different unique identifier that should look like: "commit 438hfhej2349587dnfj". You can compare changes made between commits to view changes made to files by typing the different identifiers after each other after you type git diff: git diff 498ghdj 587fndm.
🌐
Linux Man Pages
man7.org › linux › man-pages › man1 › git-log.1.html
git-log(1) - Linux manual page
The following two commands are equivalent: $ git log A B --not $(git merge-base --all A B) $ git log A...B The command takes options applicable to the git-rev-list(1) command to control what is shown and how, and options applicable to the git-diff(1) command to control how the changes each ...
🌐
Kgrz
kgrz.io › use-git-log-follow-for-file-history.html
Use --follow option in git log to view a file's history
July 19, 2019 - src/somefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) b1d2717 Fix typo src/somefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) f0ed690 Wait, log is not a function? src/somefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 42f5d2c First commit! Beginnings of a great app src/somefile.js | 3 +++ 1 file changed, 3 insertions(+) This lists out the commits of both the files. Still, the first commit of the TS file would be a single creation commit, and the last commit of the JS file would be a single deletion one. A better way to make git log follow the history of a particular file is to use the command-line switch…er…--follow and turn on the --find-renames (or -M shorthand) option: