Codementor Events

Git Commands Cheat Sheet

Published Jan 25, 2020

In this post we will be seeing Git Commands, Git is open source distributed version controlled system. This Git Commands Cheat Sheet consists of most important and widely used Git Commands.
So let’s get started,

Windows: Use Chocolatey and in powershell type

choco install git
Linux:
ubuntu: sudo apt-get update && sudo apt-get install git -redhat: sudo yum install git -h
Mac OS:
install Homebrew and Xcode

Set a user name which can be seen or associated with every commit

git config --global user.name "nuclear geeks"

Set a user email which can we seen or associated with every commit

git config --global user.email "nucleargeeks18@gmail.com"

Clone an existing repository

git clone url

Check the modified file in working directory.

git status

Add a modified file to staging area.

git add <file_name>

Add all the modified file to staging area

git add .

Commit message

git commit -m "commit_message"
## To check more advanced commands, check out this articles,

Discover and read more posts from Aditya Malviya
get started
post commentsBe the first to share your opinion
Show more replies