Hacker News new | ask | show | jobs
by fooker 30 days ago
The dangerous parts of git exist to make it trivial to undo mistakes. You don’t have to use those for your regular workflows.

With any other system, your only option is usually checking out a fresh copy from a server or backup.

2 comments

I upvoted because even though I prefer Mercurial I do like tools that are powerful and flexible.

The problem for me is that VCSes have a mental model and the way they actually work is more complicated than that. I haven't tried to deeply understand Git and in a way I slightly resent needing to - even Mercurial has the same problem in some areas but there it's more about a feature I want and the oddly contorted way they achieve it (specifically bookmarks) and it's not a situation where I get into danger and don't know how to get out.

Branches are great. I don't want to know that they're "just a pointer". :-D I'm so dull that I never use the "staging" concept because it's just a huge opportunity for making mistakes (for me). I really want something simple to reason about where I can add little complexities if I need them.

To take the bad Mercurial example - I don't really need permanent branches and I definitely don't need some new concept with oddly different commands to give me impermanence. Let me delete a branch!

Can any of the downvoters comment on this? My experience with Git is pretty much the same, but maybe Hg also allows you to unfuck a screwed up repo, just as Git does?
The bad states Git "allows you to unfuck" are largely caused by Git's awful UX (confusing and multipurpose commands based on inner workings), so Git gets no credit for "solving" a problem it caused.
Not just mistakes though, the power of git is being able to undo anything you do with git.

If you’re claiming to have never needed any kind of undo functionality, you probably don’t even need a version control system :)

You can also undo things in Mercurial - there are just fewer footguns to need undoing.
No, it's pretty easy to cause irreversible damage. This is a fairly well known advantage of git over literally everything else.

https://stackoverflow.com/questions/7376915/recover-lost-fil...

It's "easy" with a single deprecated command that no one I know of has ever needed. I didn't even know that command existed.