Prahlad Inala
Prahlad Inala


Prahlad Inala

Git Cheatsheet

Git Cheatsheet

Prahlad Inala's photo
Prahlad Inala
ยทJul 24, 2022ยท

2 min read

Play this article

Table of contents

  • What is Git?
  • Why Git?
  • Most Commonly used git commands

What is Git?

Git is a modern and widely-used distributed version control system in the world. It is developed to manage projects with high speed and efficiency. The version control system allows us to monitor and work together with our team members in the same workspace.

It is a Version Control System for tracking changes in computer files and coordinating work on those files among multiple people.

It is primarily used for source code management in software development, But it can be used to keep track of changes in any set of files.

Why Git?

  1. Open Source
  2. Scalable
  3. Distributed
  4. Security
  5. Speed
  6. Branching

Most Commonly used git commands

1. Initializing Git

git init


2. Adding files to Git

To add all files to git

git add .
git add *



To add a specific file

git add filename.extension


3. Status of git repository

git status

All files in that directory are tracked image.png

If some of the files are not tracked


4. Getting help

git help


5. Committing changes to the git repository

git commit -m "Initial commit"


6. Adding a remote repository

git remote add origin


7. Pushing the code to the remote repository

 git push -u origin master


Did you find this article valuable?

Support Prahlad Inala by becoming a sponsor. Any amount is appreciated!

See recent sponsors |ย Learn more about Hashnode Sponsors
Share this