DEV Community

Cover image for Understanding Git: A Beginner's Guide !!
Iz Mroen
Iz Mroen

Posted on

Understanding Git: A Beginner's Guide !!

Hey everyone πŸ‘‹, In this article I will introduce Git in general by explaining some basic terms πŸ’‘ so that in the next article 🌟 we will see the commands and some other things

βœ… the first thing we need to know what's Git ??

1. What is Git ❓

Git is a version management tool or VCS in English (version control system) which allows store a set of files πŸ—ƒοΈ while maintaining a timeline 🎞️ of all changes which were carried out on it.

It is part of the family of so-called decentralized VCS because in its operation each developer πŸ‘¨β€πŸ’» will have a complete local copy of the history of his source code.

βœ… Now let's explore some terms that one needs to learn to better understand the concept of Git .

2. Basic operation of Git βš™οΈ:

Git is a decentralized version management system. This means that the repository data Git is not located on a remote server but on your machine.

. a Git repository :

A β€œrepository” corresponds to the copy and import of all the files of a project in Git. There are two ways to create a Git repository:

  • You can import πŸ“₯ an existing directory into Git.

  • You can clone πŸ“‹ an already existing Git repository.

. File states :

Git manages 3 states in which files can reside: modified, indexed, & committed.
Image description

  1. Modified means that you have modified πŸ”„ the file but it has not been yet been validated in base.

  2. Indexed (β€œstaged”) means that you have marked a file modified in its version current so that it is part of the next project snapshot ➑️.

  3. Committed means that the data is stored securely in your local database πŸ›’οΈ.

. Work areas :

File states are linked to work areas in Git. Depending on its condition, a file will be able to appear in this or that work area. Every Git project is composed of three sections: the working directory, the staging area and the repository.

The working directory corresponds to a unique extraction of a version of the project. Files are extracted from the compressed database located in the directory Git and are placed on disk so that they can be used or modified.

The staging area corresponds to a simple file, generally located in the Git directory, which stores information about what will be part of the next snapshot or the next commit.

The Repository is where Git stores metadata and the database from the objects in your project. This is the main part or the heart of Git.

for the next article we will see the basic commands and some ...🧠🌟

Top comments (0)