Git Commands Cheat Sheet

A quick-reference guide to essential Git commands for efficient version control and collaboration..

Code Push

git init
git add .
git commit -m "Apna message"
git branch -M branchName
git remote add origin originUrl
git push -u origin branchName

If Code Already Exists

git status
git add .
git commit -m "Your message"
git push -u origin branchName

Check Branch Status

git status

Create New Branch

git checkout -b branchName

Check All Branches

git branch

Get Latest Code

git pull
git pull origin branchName