Useful Aliases in Git

From the Git cheat sheet · Quick Reference · verified Jul 2026

Useful Aliases

Set up shortcuts for common Git commands

bash
# Set up aliases
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.last 'log -1 HEAD'
git config --global alias.unstage 'reset HEAD --'

# Advanced aliases
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
💡 Aliases save time on common commands
⚡ Create aliases for your workflow
✅ Share useful aliases with your team

More Git tasks

Back to the full Git cheat sheet