Git Commands Cheat Sheet Created by Gursimran Singh Configuration: - git config --global user.name "Your Name": Set username - git config --global user.email "you@example.com": Set email Repository Setup: - git init: Initialize a new Git repository - git clone : Clone remote repository Basic Workflow: - git status: Show working tree status - git add : Stage file for commit - git commit -m "message": Commit staged changes - git push: Push commits to remote - git pull: Fetch and merge changes from remote Branching: - git branch: List branches - git branch : Create new branch - git checkout : Switch branch - git checkout -b : Create and switch branch - git merge : Merge branch into current Viewing History: - git log: Show commit history - git diff: Show unstaged changes - git diff --staged: Show staged changes Stashing: - git stash: Stash changes temporarily - git stash pop: Reapply stashed changes Resetting: - git reset --soft HEAD~1: Undo last commit but keep changes staged - git reset --hard HEAD~1: Undo last commit and discard changes Remote Management: - git remote -v: List remotes - git remote add origin : Add remote repo Other Useful Commands: - git fetch: Download objects and refs - git tag : Create a tag - git show : Show commit details