- Committed [Git Directory] - Most Important part of GIT
- Modified [Working Directory]
- Staged [Current Version]
Modified - We have changed the file but have not committed it to our database.
Staged - We have marked all modified files in its current version. That represents we will use the version in our next commit.
Git Directory is the location where GIT stores the metadata and object database of our project. It is the directory which we will be copied when we clone a repository.
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 us to use or modify.
Staging Area is a simple file, generally contained in our Git directory, that stores information about what will be going in our next commit.
The Basic Git workflow:
- We will modify files in our working directory.
- We will stage the files, adding snapshots of them to your staging area.
- We will commit the staged files and store them permanently into our Git Directory.
Reference Link: http://www.kernel.org/pub/software/scm/git/docs/