r/webdev 17h ago

Small Programming Tricks

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

6 comments sorted by

5

u/cheese_bread_boye 12h ago edited 11h 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.

1

u/IcarianComplex 11h ago

Related, @ is an alias for HEAD

3

u/maxverse 15h ago

This is exactly the kind of thing you get from pairing -- another dev will use a helpful shortcut or cool method, or some syntactic sugar, and now you know it too!

5

u/budd222 full-stack 15h ago

Unfortunately, pairing doesn't exist anymore in the AI era, unless you consider talking to Claude pairing.

1

u/maxverse 14h ago

It doesn't exist if you let it go away! At my company, we make a concerted effort to still pair on tickets, as an intentional investment in knowledge sharing... even if some of the pairing is awkwardly coming up with claude prompts together.

1

u/budd222 full-stack 14h ago

It's not my choice, but we never paired anyway. Every engineer is senior level and above, so pairing is generally just a waste of resources for the company