3 ms·
It's no molehill, and they are well known. Just go to stack overflow and see git questions with ~20,000 votes each! Not just that but note how many answers th
by mixmastamyk 4y ago
It's no molehill, and they are well known. Just go to stack overflow and see git questions with ~20,000 votes each! Not just that but note how many answers there are for each one, how much story-telling is involved, and how advice changed over the years:
https://stackoverflow.com/questions/tagged/git?tab=Votes https://stackoverflow.com/questions/tagged/git?tab=Votes
This is not the mark of good interface design.
The ones I look up every single time off the top of my head are:
# undo commit
git reset --soft HEAD~1
# unstage
# was git reset HEAD --
git restore --staged
I created aliases for most of the common ones, like deleting old branches:
# https://stackoverflow.com/questions/2003505
nuke = "!f() { git branch -D $1 && git push --delete origin $1; };f"
Others like checkout/switch have been fixed, but I still use my aliases from ten years ago so haven't really updated.
A few times I tried the rebase workflow geeks are always pushing. They are never around when disaster strikes, so I don't bother any more. At least merge+squash works every time.
Notice that commands like git status tell you what commands to run to fix issues; the typical user would never guess. Hg wasn't perfect but it had a lot fewer of these issues.