
7 Git Aliases That Save Me 30 Minutes Every Day
I type these 50+ times a day Add these to your ~/.gitconfig : [alias] s = status -sb co = checkout br = branch ci = commit lg = log --oneline --graph --decorate -20 undo = reset HEAD~1 --mixed amend = commit --amend --no-edit 1. git s — Short Status $ git s ## main...origin/main M src/app.py ?? tests/new_test.py Instead of the verbose default output. Shows branch tracking info in one line. 2. git lg — Visual Log $ git lg * a1b2c3d ( HEAD -> main ) Fix rate limiting bug * d4e5f6g Add retry logic to scraper | \ | * 7h8i9j0 ( feature/auth ) Add OAuth support |/ * k1l2m3n Initial commit See your entire branch history as a graph. Better than any GUI. 3. git undo — Undo Last Commit (Keep Changes) $ git undo Undoes the last commit but keeps all changes staged. Essential when you commit too early. 4. git amend — Quick Fix Last Commit $ git add forgotten_file.py $ git amend Adds staged changes to the previous commit without changing the message. I use this 10+ times a day. 5. Custom: git wip —
Continue reading on Dev.to DevOps
Opens in a new tab


