Loading...
Quick reference for essential Git commands.
git initInitialize repository
git clone <url>Clone remote repository
git add .Add all changes to stage
git commit -m 'msg'Commit with message
git push origin mainPush to remote main
git branchList local branches
git checkout -b <name>Create & switch branch
git merge <branch>Merge branch into current
git branch -d <name>Delete branch
git statusShow status
git log --onelineCompact log history
git diffShow unstaged changes
git remote -vShow remote repositories
git checkout -- <file>Discard local changes
git reset --hard HEADHard reset to HEAD
git revert <commit>Create a revert commit
Quick reference for essential Git commands.