How do I see changes in the git index?

Say I do

git add foo.txt

Now, foo’s changes are in the index (I’m assuming git was already tracking that file). Now, when I do git diff, I can’t see the changes in foo by doing

  • Specify options with git commands via LibGit2Sharp
  • How to make git mark a deleted and a new file as a file move?
  • How to retrieve untracked files with git stash
  • How to depend on Maven-managed project on GitHub?
  • How to setup GIT bare HTTP-available repository on IIS-machine
  • Findbugs for Git Pull Request
  • git diff
    

    Are there some extra things that git diff wants before it shows me those changes?

  • Install package modules for Linter package in Atom
  • Undo “git checkout HEAD foo.c” in git scm
  • bitbucket branch or repository or folders?
  • Contributing patches from Mercurial to Git?
  • How can I restore a local branch after deleting it?
  • bash file returns unexpected token `$'do\r''
  • One Solution collect form web for “How do I see changes in the git index?”

    git diff shows unstaged changes. To get the staged/cached changes, you can do git diff --cached. To get both cached and uncached changes, you can do git diff HEAD, which compares the whole working tree to the named commit (HEAD).

    Git Baby is a git and github fan, let's start git clone.