Git Aliases: Type Less, Move Faster

Suman SharmaSuman Sharma

Git Aliases: Type Less, Move Faster

If you repeat the same git commands every day, aliases turn them into muscle memory.

Aliases live in your ~/.gitconfig (or can be set globally via --global).

Speeding up Git with aliases

Quick setup

git config --global alias.co "checkout" git config --global alias.br "branch" git config --global alias.st "status" git config --global alias.lg "log --oneline --graph --all --decorate" git config --global alias.amend "commit --amend --no-edit"

The ones you’ll feel immediately

  • git co main → checkout
  • git st → status
  • git lg → beautiful history graph
  • git amend → amend last commit without editor

Extra: aliases for “power” operations

Example (careful—this deletes merged local branches):

git config --global alias.cleanup "!git branch --merged main | grep -v \"main\" | xargs git branch -d"

Next

If you want a full “how to not mess up” view of resets and recovery:

Contact

Get in Touch

Want to call me? book a call and I'll respond in the available time slot. I will ignore all soliciting.