Git Local Repository Basic Concepts

Git Local Repository Basic Concepts

Git local repository basic concepts

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have installed Git and created our 1st local repository using git init command.

https://cloudaffaire.com/how-to-install-git-in-aws-ec2-instance/

In this blog post, we will discuss some basic concepts of git local repository with examples.

 

Git local repository basic concepts:

Git local repository can be divided into three areas, working tree, staging area (also known as index) and local repository.

Working Tree: Working tree is the area where your files reside and you do modifications to your files. The directory under which you initialize your git local repo by issuing git init command is your working tree.

Staging Area: Staging area in the intermediate state between your working tree and local repository. Once you do changes in your working tree, you add those changes to the staging area by issuing git add command.

Local Repository: Local repository is the area where your changes are committed. Once you stage your changes to the staging area, you need to commit those changes using git commit command which add your changes to your local repository.

Note: Git uses .git file to track your changes and commits.

Demo:

Hope you have enjoyed this article. In the next blog post, we will discuss how to roll back changes in git local repository.

To get more details on Git, please refer below git documentation

https://git-scm.com/doc

 

Leave a Reply

Close Menu