# Git Commands

By [golden](https://paragraph.com/@goldenbit) · 2022-06-26

---

Git is a prevalent version control system ( VCS ) used by most programmers. In this blog, I am going to share some tips with basic commands to make using git easier.

To start with git, we need to understand how things work locally on the system while using git.

![](https://storage.googleapis.com/papyrus_images/a8e760c37cfc0da4dee89526a90e052c7f8601c2b63643bcd1444af286535933.png)

This diagram will help to understand, what actually happens while using git locally. Starting with the working area, the working area is where the files that are not handled by git, it is the place where all the untracked files are kept. Staging area has files that are going to be part of the next commit. The repository contains all the project commits. Using the repository we can have files as it was at some point in time.

Git Commands:

### 1\. Initializing git in your directory

The very first step that you need to do is to initialize the repository.

![](https://storage.googleapis.com/papyrus_images/fb618b5358d8e6722fff9754ddacab3e1f0f7fb804fd6465a7a22c679c71fd59.png)

### 2\. git config

This command helps you to set the username and user email address to be used with your commits respectively.

![](https://storage.googleapis.com/papyrus_images/f3af521a4da8fe280fc9e2fbbc2f630b43f27abb93161cdf061ec426717ec0a3.png)

### 3\. git status

This command is used to see the state of the working area and staging area.

![](https://storage.googleapis.com/papyrus_images/4e4b7421548f53928e520b0e3354a389a9fde27242d51da2c596373e90b7c1ab.png)

### 3\. git add

This command is used to add files to the staging area.

To take all the files that are untracked in the working area to the staging area, we use:

![](https://storage.googleapis.com/papyrus_images/c32ebfb66d6525863b023f514948dde7ada6eb939f3a3118eb5b8180c5122a37.png)

to be continue …

---

*Originally published on [golden](https://paragraph.com/@goldenbit/git-commands)*
