
Git Cheat Sheet: 60+ Commands Every Developer Should Know
Git is the foundation of modern software development, but its command surface area is enormous. This cheat sheet organizes every command you'll actually use — from daily workflow basics to advanced history rewriting — so you can find what you need quickly and understand what it does. Setup and Configuration # Set your identity (required for commits) git config --global user.name "Your Name" git config --global user.email "you@example.com" # Set default editor (VS Code shown) git config --global core.editor "code --wait" # Set default branch name for new repos git config --global init.defaultBranch main # Enable color output git config --global color.ui auto # View all config settings git config --list # Create a .gitignore template git config --global core.excludesfile ~/.gitignore_global Creating and Cloning Repositories # Initialize a new repo in the current directory git init # Initialize with a specific branch name git init -b main # Clone a remote repository git clone https://gith
Continue reading on Dev.to Webdev
Opens in a new tab




