0% found this document useful (0 votes)
36 views8 pages

Git Life Cycle

tour guide to git cycle

Uploaded by

vs13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views8 pages

Git Life Cycle

tour guide to git cycle

Uploaded by

vs13
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Project management

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 <filename>

// to add all files of the working directory 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 helps us in keeping the track of the metadata of


the files in our staging area. We specify every commit
with a message which tells what the commit is about.
• Git preserves the information or the metadata of the files that were
committed in a Git Directory which helps Git in tracking files and basically
it preserves the photocopy of the committed files.

• 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.

• git commit -m <Commit Message>


• git commit -m <Commit Message>

You might also like