Hacker News new | ask | show | jobs
by recursive 1043 days ago
I usually use reflog to answer the question "What was the name of the branch I was just working on again?"

What's supposed to be wrong with that?

2 comments

That's perfectly reasonable IMO.

If you just need to checkout the last branch you can also `git checkout -`

git config --global alias.recent for-each-ref --count=20 --sort=-committerdate --format='%(committerdate:short): %(refname:short)' refs/heads/

use it like

    > git recent
    2023-08-07: jimkubicek/add-journal-table-creator
    2023-08-07: main
    2023-07-28: backup/git-squash-to-main
    2023-07-28: backup/cleanup