Git Cheat Sheet

What is Git and GitHub?

Git is a version control system, meaning that it keeps track of every version of your codebase. This way, if you need to find or revert to a previous version, you can do so easily. Because it's so easy to use, Git has become one of the most popular tools among the developer community. Git works with any type of file, so it doesn't matter what programming language you're working within the codebase

Github is a website that allows you to store your code on the web. Storing your code on the web has a number of advantages, including backing up your code and collaborating on your code with others.

Git Commands for Beginners like me :)

Git configuration : Set the username and email for git configuration

git config --global user.name "User Name"

git config --global user.email "Email"


Creating a local repo

git init


Creating a local copy

git clone


Display the state of the working directory and the staging area

git status


Adding file to staging area

git add <file>

git add . If you want to add every change at once, you can run the command:


Commit the staged changes

git commit -m "<message>"


History of all the commits

git log


Updating the committed changes to the remote server

git push -u origin <branch_name>


Updating from remote repo to local repo

git pull origin


I hope now you can run basic Git commands on your own :)