What's the difference between the index, cached, and staged in git?

Are these the same thing? If so, why are there so many terms?!

Also, I know there is this thing called git stash, which is a place where you can temporarily store changes to your working copy without committing them to the repo. I find this tool really useful, but again, the name is very similar to a bunch of other concepts in git -> this is very confusing!!

  • How to have Git show a file's version history
  • source control structure for a kohana based project
  • How to deploy to Heroku directly from my Gitlab repository
  • What does “fatal: You are on a branch yet to be born” mean in this context
  • GIT clone and first GIT push issue
  • How to delete everything inside GIT repository?
  • What's the most proper way to remove an already deleted branch from tab-completion history?
  • Git Hook Fails Silently
  • Git: How to list branches with info about tracked remote?
  • Colorize files in SublimeText tree-view based on git status?
  • XCode Version 7.1 (7B91b) and TFS 2013 GIT Authentication Failure
  • Force git custom merge driver for the purpose of merging pom.xml (maven) files
  • One Solution collect form web for “What's the difference between the index, cached, and staged in git?”

    The index/stage/cache are the same thing – as for why so many terms, I think that index was the ‘original’ term, but people found it confusing, so the other terms were introduced. And I agree that it makes things a bit confusing sometimes at first.

    The stash facility of git is a way to store ‘in-progress’ work that you don’t want to commit right now in a commit object that gets stored in a particular stash directory/database). The basic stash command will store uncommitted changes made to the working directory (both cached/staged and uncached/unstaged changes) and will then revert the working directory to HEAD.

    It’s not really related to the index/stage/cache except that it’ll store away uncommitted changes that are in the cache.

    This lets you quickly save the state of a dirty working directory and index so you can perform different work in a clean environment. Later you can get back the information in the stash object and apply it to your working directory (even if the working directory itself is in a different state).

    The official git stash manpage has pretty good detail, while remaining understandable. It also has good examples of scenarios of how stash might be used.

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