3 ms·
I agree that if you're having to use the reflog frequently, you're using git wrong (not least of which because the reflog is not designed for readability and un
by Espressosaurus 3y ago
I agree that if you're having to use the reflog frequently, you're using git wrong (not least of which because the reflog is not designed for readability and understanding the context where it came from).
But for the rest? If you're working in a repo with more than 5 people, rebase, cherry-pick, and squash are necessary to keep your sanity. Merge nodes are awful once you get beyond more than maybe 3 developers.
- jkubicek 3y agoSomeone else pointed out that it's probably confusing that I didn't mention that I do religiously squash my branches before committing, so we still have multiple developers with a clean main branch and no merge commits.
- recursive 3y agoI 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?
- pcthrowaway 3y agoThat's perfectly reasonable IMO. If you just need to checkout the last branch you can also `git checkout -`
- jkubicek 3y agogit 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