It should just be:
git diff --cached
--cached
means show the changes in the cache/index (i.e. staged changes) against the current HEAD
. --staged
is a synonym for --cached
.
--staged
and --cached
does not point to HEAD
, just difference with respect to HEAD
. If you cherry pick what to commit using git add --patch
(or git add -p
), --staged
will return what is staged.
Related Contents:
- What are the differences between double-dot “..” and triple-dot “…” in Git diff commit ranges? [duplicate]
- How to read the output from git diff?
- git-diff to ignore ^M
- How can I get the diff between all the commits that occurred between two dates with Git?
- Make ‘git diff’ ignore ^M
- How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?
- How can I see the changes in a Git commit?
- Ignore *all* whitespace changes with git-diff between commits
- Using git diff, how can I get added and modified lines numbers?
- How to make ‘git diff’ ignore comments
- How to grep (search) committed code in the Git history
- How do I view ‘git diff’ output with my preferred diff tool/ viewer?
- What are the differences between double-dot “..” and triple-dot “…” in Git commit ranges?
- Viewing unpushed Git commits
- How to list only the names of files that changed between two commits
- Distributed Version Control Systems and the Enterprise – a Good mix? [closed]
- Showing which files have changed between two revisions
- Merging: Hg/Git vs. SVN
- How can I see the differences between two branches?
- Git: list only “untracked” files (also, custom commands)
- git diff – show me line ending changes?
- What is the Difference Between Mercurial and Git?
- Git under windows: MSYS or Cygwin?
- How do I diff the same file between two different commits on the same branch?
- git push to multiple repositories simultaneously [duplicate]
- How to compare files from two different branches
- How can I see incoming commits in git? [duplicate]
- How do I see the differences between two branches?
- What is `git diff –patience` for?
- Git interoperability with a Mercurial Repository
- How to see the changes between two commits without commits in-between?
- Transferring legacy code base from cvs to distributed repository (e.g. git or mercurial). Suggestions needed for initial repository design [closed]
- use Winmerge inside of Git to file diff
- Trying to understand `git diff` and `git mv` rename detection mechanism
- Coloring white space in git-diff’s output
- Where does the excerpt in the git diff hunk header come from?
- Getting the difference between two repositories
- Locking binary files using git version control system
- What does “@@ -1 +1 @@” mean in Git’s diff output?
- How resolve multiple conflicts with “git mergetool” without having to close the editor between files?
- Show diff between commits
- Making git diff –stat show full file path
- Hg: How to do a rebase like git’s rebase
- What does the “@@…@@” meta line with at signs in svn diff or git diff mean?
- Git: How can I find a commit that most closely matches a directory?
- How can I get a git submodule’s associated commit ID from a past commit in the parent clone?
- diff returning entire file for identical files
- How does Git track history during a refactoring?
- Git Diff of same files in two directories always result in “renamed”
- git difftool to give directory compare?