To see all the diff in tracked files but not staged:

git diff

or

git diff path/to/a/given/file

to see the diff only for a file. You can also see the diff in a given sub-directory of your project:

git diff path/to/a/dir/

If you have already staged the changes with git add, you can see what patch you have staged with

git diff --staged

You can also specify a path with --staged.

Answer from lrineau on Stack Overflow
🌐
GitHub
docs.github.com › articles › tracing-changes-in-a-file
Viewing and understanding files - GitHub Docs
November 28, 2022 - This view gives you a line-by-line revision history, with the code in a file separated by commit. Each commit lists the author, commit description, and commit date. To see versions of a file before a particular commit, click .
Discussions

git - How to see changes to a file before commit? - Stack Overflow
I have tried git commit -v ubuntu@ip:~/agile$ git commit -v # On branch master # Changes not staged for commit: # (use "git add ..." to update what will be committed) # (use "git More on stackoverflow.com
🌐 stackoverflow.com
Is there a way to see how a file looked like at a certain point in time on GitHub?
find the right commit, click on it, click brows files, find your file. More on reddit.com
🌐 r/github
4
9
December 16, 2018
"View File at Revision" for files in the Commit Details View
On the commit detail view, for a file that was affected by a commit, I can Open a diff view of the file in for this commit Open the current version of this file ("Click to open file"). Ho... More on github.com
🌐 github.com
6
March 31, 2020
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
🌐
GitHub
github.com › sindresorhus › refined-github › issues › 3289
Add "view file before commit/PR" · Issue #3289 · refined-github/refined-github
June 26, 2020 - For the longest time I have been doing this manually, by clicking "view file" and then editing the URL to add a ^ at the end of the commit (to reference the parent commit). It would be very useful if this was added as a link in the menu, so ...
Author   refined-github
Top answer
1 of 2
76

To see all the diff in tracked files but not staged:

git diff

or

git diff path/to/a/given/file

to see the diff only for a file. You can also see the diff in a given sub-directory of your project:

git diff path/to/a/dir/

If you have already staged the changes with git add, you can see what patch you have staged with

git diff --staged

You can also specify a path with --staged.

2 of 2
35

Make sure you've staged some changes. Otherwise, git commit -v will show you a block similar to what you posted, but not do anything. You can stage changes manually with git add, or if the files are already versioned, you can use git commit -a -v to stage and commit the changes.

For example:

$ echo "more foo" >> foo.txt
$ git commit -v
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   foo.txt
#
no changes added to commit (use "git add" and/or "git commit -a")

Staging the change shows the diff with git commit -v:

:: git add foo.txt
:: GIT_EDITOR=cat git commit -v

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   foo.txt
#
diff --git a/foo.txt b/foo.txt
index 257cc56..a521556 100644
--- a/foo.txt
+++ b/foo.txt
@@ -1 +1,2 @@
 foo
+more foo
Aborting commit due to empty commit message.

If you just want to see the diff without committing, use git diff to see unstaged changes, git diff --cached to see changes staged for commit, or git diff HEAD to see both staged and unstaged changes in your working tree.

UPDATE: given your edit, what you really want are the git diff derivatives above. I'm not sure how Aptana Studio works. It may not follow the typical command line git flow. On the command line, you'd stage your changes, and then commit. And the above git diff commands are what you'd use to examine those changes. I typically alias them as git unstaged, git staged, and git both by adding this to my ~/.gitconfig:

[alias]
    # show difference between working tree and the index
    unstaged = diff

    # show difference between the HEAD and the index
    staged = diff --cached

    # show staged and unstaged changes (what would be committed with "git commit -a")
    both = diff HEAD
🌐
Sara Ford's Blog
saraford.net › 2017 › 01 › 26 › how-to-view-all-files-in-a-repo-for-a-given-commit-on-a-given-branch-on-github-com-026
How to view all files in a repo for a given commit on a given branch on GitHub.com – 026
January 26, 2017 - To be honest, all I know right now is that every Git commit has a tree, so this dropdown button label is saying, “show me the files for this commit id.” You’ll also notice that · You’ll see that this Tree:ad98b093 commit id matches the id in the far right. You might be wondering why the dropdown doesn’t show the list of all the possible trees to view.
🌐
GitHub
github.blog › home › changelogs › view file at a specific point in the commit history
View file at a specific point in the commit history - GitHub Changelog
March 22, 2025 - When viewing the commit history of a single file, users can now click to view that file at the selected point in history.
🌐
Tom de Bruijn
tomdebruijn.com › posts › git-review-changes-before-committing
Git: Review changes before committing | Tom de Bruijn
October 26, 2020 - I click on the file in the "Staged Changes" view in the left panel. Here I see the changes the one line change I just staged and nothing else. If these are all the changes I need, I can now commit them without also committing the unstaged changes. I hope this peek into how I review my changes before committing helps you make better commits.
Find elsewhere
🌐
CodeGenes
codegenes.net › blog › how-to-view-file-diff-in-git-before-commit
How to View Git File Diff Before Commit: Preview Changes You Forgot in Specific Files — codegenes.net
The solution? Previewing changes with git diff before committing. Git’s diff command lets you inspect modifications at every stage—before staging files, after staging, and even for specific files you might have overlooked.
🌐
SysTutorials
systutorials.com › how-to-view-a-file-at-a-specific-commit-in-git
View A File At A Specific Git Commit - SysTutorials
April 12, 2026 - # View file content at a specific commit git show commit_hash:path/to/file # Example git show a1b2c3d:src/main.py
🌐
GitHub
docs.github.com › articles › differences-between-commit-views
Differences between commit views - GitHub Docs
When Git shows the history of a single file, it simplifies history by omitting commits that did not change the file. Instead of looking at every commit to decide whether it touched the file, Git will omit a whole branch if that branch, when merged, did not impact the final contents of the file.
🌐
GitHub
github.com › mhutchie › vscode-git-graph › issues › 286
"View File at Revision" for files in the Commit Details View · Issue #286 · mhutchie/vscode-git-graph
March 31, 2020 - Open the current version of this file ("Click to open file"). However, I think it would be nice to be able to open a read-only view of this specific revision, without the diff view.
Author   mhutchie
🌐
GitHub
docs.github.com › en › enterprise-cloud@latest › repositories › working-with-files › using-files › viewing-and-understanding-files
Viewing and understanding files - GitHub Enterprise Cloud Docs
This view gives you a line-by-line revision history, with the code in a file separated by commit. Each commit lists the author, commit description, and commit date. To see versions of a file before a particular commit, click .
🌐
Reddit
reddit.com › r/git › newbie question: how do i view the contents of a file already commited?
r/git on Reddit: Newbie question: how do I view the contents of a file already commited?
April 28, 2022 -

I don't want to see the changes, just how the file exists in the commited state. I know I can check out the commit and see it, but is there a way to do so without the checkout? Probably a stupid newbie question, thanks for the help.

🌐
Git
git-scm.com › book › en › v2 › Git-Basics-Recording-Changes-to-the-Repository
2.2 Git Basics - Recording Changes to the Repository
If the file didn’t exist before, and you run git status, you see your untracked file like so: $ echo 'My Project' > README $ git status On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) README nothing ...