Alexa Web Servers Blog

80 Essential Git Commands Every Developer Should Know

Consejos prácticos sobre WordPress, servidores, rendimiento, seguridad y mantenimiento para negocios que quieren una presencia online seria.

Publicado el July 19, 2026

## Essential Git Commands Every Developer Should Know

Git is the backbone of modern version control. Whether you’re working solo or on a team of 50, these commands will cover 95% of your daily workflow.

### Configuration

“`bash
git config –global user.name “Your Name”
git config –global user.email “your@email.com”
git config –global init.defaultBranch main
git config –global alias.co checkout
git config –global alias.br branch
git config –global alias.st status
“`

### Starting a Repository

“`bash
git init # Create new repo
git clone # Clone existing repo
git clone –depth 1 # Shallow clone (faster)
“`

### Daily Workflow

“`bash
git status # See what’s changed
git add # Stage changes
git add . # Stage all changes
git commit -m “message” # Commit staged changes
git commit -am “message” # Add and commit in one step
git push origin main # Push to remote
git pull # Pull latest changes
“`

### Branching

“`bash
git branch # Create branch
git checkout # Switch to branch
git checkout -b # Create and switch
git branch -d # Delete branch
git merge # Merge branch into current
“`

### Undoing Changes

“`bash
git restore # Discard unstaged changes
git restore –staged # Unstage a file
git reset –soft HEAD~1 # Undo last commit (keep changes)
git reset –hard HEAD~1 # Undo last commit (discard changes)
git revert # Safe undo via new commit
“`

### Stashing

“`bash
git stash # Save uncommitted work
git stash pop # Restore latest stash
git stash list # List stashes
git stash drop # Delete latest stash
“`

### Viewing History

“`bash
git log –oneline # Compact history
git log –graph –all # Visual branch history
git diff # Show unstaged changes
git diff –staged # Show staged changes
git blame # Who changed what
“`

### Working with Remotes

“`bash
git remote -v # List remotes
git remote add origin # Add remote
git fetch origin # Fetch without merging
git pull –rebase # Pull with rebase
“`

### Advanced

“`bash
git cherry-pick # Apply specific commit
git rebase -i HEAD~3 # Interactive rebase
git bisect start # Binary search for bugs
git submodule add # Add submodule
“`

**📚 Want all these commands in a printable reference?** Download the [Git Commands Cheat Sheet ($2.99)](https://ovidia1.gumroad.com/l/devops-git) with 70+ commands covering GitFlow, interactive rebase, submodules, and troubleshooting.

**💡 Browse the full collection:** [DevOps Cheat Sheets](https://ovidia1.gumroad.com) — 15+ quick references for developers and sysadmins. Use code **LAUNCH20** for 20% off.

💬 ¿Hablamos ahora?