$ ./guess_the_languageGit
Git · easy · #4

What does this command compare?

git diff --staged
  1. The working tree against the index
  2. The working tree against the last commit
  3. The local branch against its upstream
  4. The index against the last commit
--staged (same as --cached) shows what the next commit would contain compared with HEAD. Plain git diff compares the working tree with the index.
Play Git ▸