DEV Community

Hàm Hương
Hàm Hương

Posted on

3 Simple Git Aliases That Save Me 15 Minutes Every Single Day

You don't need a massive Zsh plugin pack to speed up your daily Git workflow. Adding three short aliases to your ~/.gitconfig eliminates the repetitive commands you type 40 times a day.

1. git st — Clean Short Status

Instead of typing git status and reading 15 lines of boilerplate hints, use -sb (short + branch):

[alias]
  st = status -sb
Enter fullscreen mode Exit fullscreen mode

Output looks like:

## main...origin/main
 M src/index.ts
?? notes.md
Enter fullscreen mode Exit fullscreen mode

2. git lg — Readable One-Line Commit Graph

Standard git log takes up your whole terminal screen for just 3 commits. This one-liner gives you a compact colorized tree with relative timestamps:

[alias]
  lg = log --oneline --graph --decorate --all -n 15
Enter fullscreen mode Exit fullscreen mode

3. git undo — Undo the Last Local Commit Safely

Committed to main by mistake or forgot to stage one file? Instead of memorizing --soft vs --mixed, alias it:

[alias]
  undo = reset --soft HEAD~1
Enter fullscreen mode Exit fullscreen mode

It keeps all your changes staged and ready to fix without touching your working tree.


What is the one Git alias you install on every new machine first? Drop yours in the comments!

Top comments (0)