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

  • Pushing subtrees in a git repo
  • How can I set up Git for local commits while using P4 for remote commits?
  • How do I force fetching of tags if I have the --no-tags option set
  • Git pull reverted commits in master?
  • git svn clone malformed index info error
  • Corporate adoption rate of Git?
  • git diff

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

  • how to share odt/doc documents over git
  • Github: Clean up fork after pull request
  • Collaborate using Git without Remote Server
  • Why does “git rebase” leave opposite sets of modifications in the stage and the working copy?
  • git fatal: SHA1 COLLISION FOUND
  • How can I pull all branches in SourceTree?
  • 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.