The Git Cheat Sheet Every Developer Should Bookmark (2026 Edition)
Git has ~150 commands. You actually need about 20. Here are the ones that matter. Setup (do this first) git config --global user.name "Your Name" git config --global user.email "[email protected]" gi...

Source: DEV Community
Git has ~150 commands. You actually need about 20. Here are the ones that matter. Setup (do this first) git config --global user.name "Your Name" git config --global user.email "[email protected]" git config --global init.defaultBranch main git config --global pull.rebase false # Better diff and merge tools git config --global diff.tool vscode git config --global merge.tool vscode Starting a project # New project git init git add . git commit -m "Initial commit" git remote add origin https://github.com/you/repo.git git push -u origin main # Clone existing git clone https://github.com/user/repo.git git clone https://github.com/user/repo.git my-folder # Custom folder name Daily workflow # Check what's changed git status git diff # Unstaged changes git diff --staged # Staged changes (what will be committed) # Stage files git add file.js # Specific file git add src/ # Entire folder git add -p # Interactive: choose which hunks to stage # Commit git commit -m "Fix login bug" git commit -am "Qu