Actions

EmSys

Git - Three States

From EdWiki

Three States

  • Git has three main states that your files can reside in:
  1. Modified: means that you have changed the file but have not committed it to your database yet.
  2. Staged: means that you have marked a modified file in its current version to go into your next commit snapshot.
  3. Comitted: means that the data is safely stored in your local database.


Git-three-states.png
  • The Git directory is where Git stores the metadata and object database for your project. It is what is copied when you clone a repository from another computer.
  • The working directory is a single checkout of one version of the project. These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.
  • The staging area is a simple file, generally contained in your Git directory, that stores information about what will go into your next commit. It's sometimes referred to as the index.