Use a command like:

git diff file_2.rb

See the git diff documentation for full information on the kinds of things you can get differences for.

Normally, git diff by itself shows all the changes in the whole repository (not just the current directory).

Answer from Greg Hewgill on Stack Overflow
🌐
Graphite
graphite.com › guides › git-view-changes
How to view changes in Git - Graphite
This guide will explore the different methods to view changes in Git, using commands like `git diff`, `git status`, and others.
Discussions

What command can view who changed specific line of a file?
You probably want: git blame $filename This will output the file with each line annotated with the commit hash, date and author at which the line was last changed. This uses the same logic that git diff uses to calculate diffs. (Remember, Git does not directly store changes; it calculates changes on the fly as required.) You can provide extra options to see the file as of a particular commit, or to ignore certain uninteresting changes. More on reddit.com
🌐 r/git
4
4
May 9, 2021
How can I see what has changed in a file before committing to git? - Stack Overflow
I've noticed that while working on one or two tickets, if I step away, I'm not sure what I worked on, what changed, etcetera. Is there a way to see the changes made for a given file before git add... More on stackoverflow.com
🌐 stackoverflow.com
Is there a way to use 'git show' on staged changes?
Found an answer! Leaving this up in case others stumble upon it https://stackoverflow.com/questions/5153199/git-show-content-of-file-as-it-will-look-like-after-committing More on reddit.com
🌐 r/git
4
6
July 28, 2022
Is there any tool that can show me the progression of the changes made in any file by checking all historical commits?
Something like this? git log -p --reverse -- path/to/that_file.py More on reddit.com
🌐 r/git
14
4
November 17, 2022
🌐
Opensource.com
opensource.com › article › 21 › 4 › git-whatchanged
Find what changed in a Git commit | Opensource.com
Not only can you see which files changed, but you can also make git log display exactly what changed in the files. Your Git log can produce an inline diff, a line-by-line display of all changes for each file, with the --patch option: commit ...
🌐
Git Tower
git-tower.com › learn › git faq › git diff - inspecting changes in git
Git Diff - Inspecting Changes in Git | Learn Version Control with Git
3 days ago - Learn how to use the "git diff" command to compare changes in your Git project. See differences in your working copy, commits, and branches.
🌐
Git Tower
git-tower.com › learn › git › ebook › en › command-line › advanced-topics › diffs
Inspecting Changes with Diffs | Learn Git Ebook (CLI Edition)
Without further options, "git diff" will show us all current local changes in our working copy that are unstaged. If you want to see only changes that have already been added to the Staging Area, "git diff --staged" is your command of choice.
🌐
Team Treehouse
teamtreehouse.com › library › introduction-to-git › viewing-changes-to-a-file
Viewing Changes to a File (How To) | Introduction to Git | Treehouse
Open up medals.html, and at the top add a level 1 heading: <h1>Welcome to our store!</h1>. Also add a descriptive paragraph: <p>Please choose a section below.</p> Once the file is saved, we can use the git diff command to view those changes.
Published   March 29, 2018
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-view-the-change-history-of-a-file-using-git-versioning
Tracking File Changes Using Git - GeeksforGeeks
January 16, 2026 - To view the changes that were made in a particular commit, we can use the git show command.
🌐
Tosbourn
tosbourn.com › articles › web dev › git command to show files changed in a commit
Git command to show files changed in a commit - Tosbourn
Review of Tosbourn Ltd.
How to see exactly which files have changed in a single commit Toby had helped shape the digital team practice around Agile and ways of working on multidisciplinary teams, which was new to a lot of folks. I only heard great feedback about people's experience working with Toby - how inspiring and humble he is as a leader.
Rating: 5 ​
🌐
Git Scripts
gitscripts.com › git-show-files
Git Show Files: A Quick Guide to Viewing Your Changes
September 27, 2025 - A common example includes piping commands: git log -1 --oneline | cut -d' ' -f1 | xargs git show · In this example, the syntax retrieves the latest commit hash and displays its details, streamlining your workflow.
🌐
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 - To see the actual lines changed in a specific commit you can use git show command. The git show command takes the commit id and then shows the files changed in that commit. You can get the commit id of a specific commit by using git log.
🌐
Career Karma
careerkarma.com › blog › git › git diff: a how-to guide
Git Diff: A How-To Guide: A Step-By-Step Guide | Career Karma
December 1, 2023 - This is an example of the Git diff feature. This is a typical result from the git diff command. Our result shows what has been added or removed in our file in a combined diff format.
🌐
freeCodeCamp
freecodecamp.org › news › git-diff-command
Git diff Command – How to Compare Changes in Your Code
March 29, 2022 - It doesn't look for staged and unstaged changes. You can run git diff <commit_hash> <commit_hash> the command to compare the changes between two commits. Like branch comparison, order does matter in comparing commits.
🌐
Graphite
staging-graphite-splash.vercel.app › guides › git-view-changes
How to view changes in Git
This guide will explore the different methods to view changes in Git, using commands like `git diff`, `git status`, and others.
🌐
LabEx
labex.io › tutorials › git-how-to-check-if-a-file-has-changes-in-git-560022
How to Check If a File Has Changes in Git | LabEx
Let's check the content of the file to confirm the change: ... Hello, Future Me P.S. Hope you're doing well! Now, let's see how Git sees this change. Run the git status command:
🌐
Refine
refine.dev › home › blog › engineering › git diff - comparing changes in git
git diff - Comparing Changes in Git | Refine
July 30, 2024 - ... We have added a new line to the existing file "testDiff.txt". Here we have added our changes to the staging area. Now, we will execute the command git diff –staged to view the difference between the staging area and the last commit.
🌐
Git
git-scm.com › docs › git-diff
Git - git-diff Documentation
It is incorrect to apply each change to each file sequentially. For example, this patch will swap a and b: diff --git a/a b/b rename from a rename to b diff --git a/b b/a rename from b rename to a · Hunk headers mention the name of the function to which the hunk applies. See "Defining a custom hunk-header" in gitattributes[5] for details of how to tailor this to specific languages. Any diff-generating command can take the -c or --cc option to produce a combined diff when showing a merge.
🌐
Medium
medium.com › swlh › using-git-to-open-modified-or-changed-files-since-previous-commit-2bcba8cb099f
Using Git to Open Modified or Changed Files Since Previous Commit | by Nafeu Nasir | The Startup | Medium
September 22, 2020 - echo "baz" > exampleA.txt git add --all git commit -m "Second commit." ... $ git --no-pager log --oneline --decorate 9d17441 (HEAD -> master) Second commit. f5c2b44 First commit. ... This command allows us to list files that have been modified ...
🌐
Codingem
codingem.com › home › git list changed files between commits (examples)
Git List Changed Files between Commits (Examples)
July 10, 2025 - When you run git diff with the –stat option, you’ll not only see the files that changed between commits but also the number of lines and additions/deletions.