5 ms·
That was not my experience at all. Consider just the simple task of "forget about the last commit I made." Mercurial has like five different ways to do this (h
by sio8ohPi 4y ago
That was not my experience at all.
Consider just the simple task of "forget about the last commit I made." Mercurial has like five different ways to do this (hg rollback, hg uncommit, hg strip, hg prune, hg histedit), which work in three totally different ways under the hood (obsolescence markers, backup bundles, or just YOLOing it in the case of Rollback), and which may change their behavior depending on whether you're using `evolve`. As a novice, it's not clear which you should be using (hint: use the evolve extension) or how to recover from mistakes.
Git also has several ways to do it, but all operating on the same principles. Whether you `git reset` or `git branch -m`, or `echo $(git rev-parse $BRANCH~) > .git/refs/heads/$BRANCH`, you're just moving pointers around, and the reflog makes recovery simple.
- LAC-Tech 4y agoConsider just the simple task of "forget about the last commit I made." Mercurial has like five different ways to do this (hg rollback, hg uncommit, hg strip, hg prune, hg histedit), Wow 5 commands, none of which have a confusing - or -- flag, or are an overload of another command? That's really impressive. I've been using git non-stop for 7 years at this point. I have no idea how to "forget about the last commit I made." off the top of my head. I'm sure one day soon I'll need to do it, will look it up, and then forget it immediately because gits cli makes no sense.
- nindalf 4y agoI can’t remember git commands either. I simply add them to my git config. So I type “git uncommit” and get the behaviour I need. For example: git config --global alias.uncommit 'reset --soft HEAD^'
- benibela 4y agoThe best UX has TortoiseHg Just click the Undo-Button: https://tortoisehg.readthedocs.io/en/latest/_images/commit.png https://tortoisehg.readthedocs.io/en/latest/_images/commit.p...
- sio8ohPi 4y agoJust from a quick read of the docs, isn't 'undo' just 'rollback' (dangerous, deprecated)? Can you undo an undo?
- BeetleB 4y agoThe amusing thing about your comment? I could immediately think of at least one way to do it in Mercurial, whereas with git I didn't - I would have to Google it. And in the last 3 years I used Git a lot more than Mercurial.
- sio8ohPi 4y agoAgain, I've had the opposite experience. I've used nothing but Mercurial at work for the last 2.5 years, and yet how to do this in git was obvious (and `git rebase -i HEAD~` gives a fourth way). But even using Mercurial day-to-day, I had to look up whether `hg strip` or `hg uncommit` has `evolve` integration (no and yes, respectively), and I'm not sure I could fix botched history edits.