Git Life Cycle
Git Life Cycle
with Git
Git lifecycle
• When a directory is made a git repository, there are
mainly 3 states which make the essence of Git Version
Control System. The three states are
• Working Directory
• Staging Area
• Git Directory
Working Directory
• Whenever we want to initialize our local project directory to make it a
git repository, we use the git init command.
• After this command, git becomes aware of the files in the project
although it doesn’t track the files yet.
Staging Area
• Now, to track the different versions of our files we use the command
git add. We can term a staging area as a place where different
versions of our files are stored.
• git add command copies the version of your file from your working
directory to the staging area.
• You can find your staging area in the .git folder inside the index file.
• git add command copies the version of your file from your working directory to the staging area.
• Staging AreStagi
• After this command, git becomes aware of the files in the project although it doesn’t track the files yet.
// to specify which file to add to the staging area
git add
Git Directory
• Now since we have all the files that are to be tracked and
are ready in the staging area, we are ready to commit our
files using the git commit command.
• Commit also stores the name of the author who did the commit, files that
are committed, and the date at which they are committed along with the
commit message.