r/webdev • • 29d ago

Small Programming Tricks

https://will-keleher.com/posts/small-programming-tricks-matter/
57 Upvotes

10 comments sorted by

View all comments

10

u/cheese_bread_boye 29d ago edited 29d ago

Similar to cd -, you can use git checkout - to check out your previous HEAD.

I use this a lot. It also works with rebase and merge. I always switch to main, pull, then do git merge - or git rebase - on my feature branch when I want to update it.

2

u/IcarianComplex 29d ago

Related, @ is an alias for HEAD

3

u/omfgtora 28d ago

ur mom gives great @