I am lazy. But usefully lazy.
I believe that if you type the same long command more than three times a day, you should shorten it. Git commands can be verbose, but Git has a built-in aliasing system to fix that.
Git Aliases: Configuration Basics with git config --global alias
Git aliases are shortcuts that map short commands to longer Git functions, defined in your .gitconfig file (usually in your home directory) or set directly from the command line. Aliases created with the --global flag apply across every repository on your machine; aliases created without it apply only to the current repository, stored in that repoβs .git/config file instead.
Here git config --global alias.co checkout allows you to type git co instead of git checkout.
Here are my top essential aliases.
Configuring Basic Git Navigation Aliases (co, br, ci, st)
Run these in your terminal to set them up:
# Basic navigation
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
# Unstaging files (undoing 'git add')
git config --global alias.unstage 'reset HEAD --'
Now, checking status is just git st. It saves milliseconds, but they add up to a feeling of fluidity.
Git Log Alias: Colorized Graph Output with git lg
π Subscribe to keep reading.
Amending Commits with the Git Oops Alias (commit --amend --no-edit)
π Subscribe to keep reading.
Key Takeaway: Git Aliases Reduce Repetitive Command Typing
π Subscribe to keep reading.
You've hit a Deep Dive tutorial.
I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):
Full content temporarily unavailable β refresh in a moment
Already a subscriber? Use the magic link from your last newsletter, or reset your password.
Log in to unlock
New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in β use the same email afterwards.