DEV Community

Kaushik V
Kaushik V

Posted on

Git Architecture & Installation

Git is a powerful version control system that helps developers track changes in their projects. In this blog, weโ€™ll explore Gitโ€™s architecture, how it works, and how to install it on your system.

Git Architecture

Git follows a structured workflow that involves multiple stages before the code reaches a remote repository.

1. Working Directory
This is where we create and modify files for our project. Any new or updated files is located here before being staged for commit.

2. Staging Area
When we run git add, the changes move from the working directory to the staging area. This means the files are ready to be committed but are not yet permanently stored in the repository.

3. Local Repository
Running git commit saves the staged changes into the local repository. This stores a history of all committed changes.

4. Remote Repository
Once we are ready to share the changes with others, we can use git push to upload the commits to a remote repository (such as GitHub or GitLab).


Installing Git

To start using Git, we have to install it in the system. These steps should be followed:

  • Open the terminal

On Linux, use Ctrl + Alt + T to open the terminal.
On macOS, use the Terminal app.
On Windows, use Git Bash or Command Prompt.

Note: Here I will be using Linux to install Git. The process is the same for all Operating Systems but only the commands slightly differ.

  • enter the command - sudo apt install git

The terminal will ask the user about the system's password to complete the installation. The version installed can be checked using the command

git --version


Top comments (0)