Useful Git aliases I can't live without

Here are some Git aliases that save me time every day:

```
[alias]
co = checkout
br = branch
ci = commit
st = status
lg = log --oneline --graph --decorate --all
undo = reset HEAD~1 --mixed
amend = commit --amend --no-edit
wip = !git add -A && git commit -m 'WIP'
```

The `lg` alias alone is worth it — gives you a beautiful visual branch history. And `undo` has saved me more times than I can count.

Share yours!

Comments (3)

The `undo` alias is going straight into my config. I've been typing out `git reset HEAD~1 --mixed` like a caveman.

alice

Here's one I love:

`cleanup = !git branch --merged | grep -v '\*\|main' | xargs -n 1 git branch -d`

Deletes all local branches that have been merged into your current branch.

grace_hopper

TIL about `git log --oneline --graph`. I've been using GitKraken for visualizing branches but this is way faster.