Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Mercurial got the "user interface" and command-set right and has some nifty features (being able to launch a web server on the fly to get a tree view of your changes) but being written in Python, performance and scalability aren't ideal.

I used to think Mercurial had a better UI but I changed my mind after taking the time to understand Git. Mercurial does have nifty features but Git's way of working isn't hard or especially counterintuitive. You must learn the terminology to properly understand it, but after that it's smooth sailing. Git actually has fewer moving parts than Mercurial, as there are less extraneous features. Instead of 3 or more categories of "branch-like" graph structures like Mercurial, you get branches as refs in Git. Every named leaf in the commit graph is a branch or a tag, and those have simple properties. There are surely git plugins to add more metadata but you don't really need that.

Git too has a web interface by default: https://git-scm.com/docs/gitweb Of course there are many Github-like solutions specifically catered to hosting repos and entire project workflows with Git too.



You must learn the terminology to properly understand it, but after that it's smooth sailing

This promise never held to me. I know the terminology and “how”, but it never got clear in my mind how to express day to day things which aren’t clone/add/commit/push. It’s just bad unmemorable ui that is both cumbersome to use and reason about.

I do have trouble remembering things but not like this with any other tool. For example, with ffmpeg and magick I could make them work without a manual. With git I can only damage things irrepairably.


Lol if you can remember how to use ImageMagick and Ffmpeg but not Git, I don't get it. Those programs do have very different argument passing styles than Git, but Git uses the same style as most every other unix/linux program. If you use it and know what you're doing, you should not be able to lose any work.

My advice to get over the hump you're on is to commit more often, check the status more often (`git diff [--staged]` and `git status`), and make sure you're branching or tagging enough to not lose commits. Then work on how to edit commits with `git rebase -i`. You can use rebase and cherry-pick to eliminate any unwanted commits or branches easily (notwithstanding conflicts, which are another critical thing to learn). If you feel like you messed up, you can almost always `git reset --hard` to the last commit you were on. If you forgot which commit you were on, there's the reflog. Generally, to be good at Git you have to take a few hours to learn it. It differs from the other programs you mentioned because there are different problems you can encounter at various points while using Git, whereas those other ones just succeed or fail and don't usually fail in unrecoverable ways (you just run them again until you're satisfied with the output). You can iterate on modifications to your commit history with Git but that is trickier and riskier.

There are many excellent Git tutorials online that explain everything an ordinary user needs, including rebases and the reflog. I think Github has one. Maybe that's what you need to figure it out, in addition to practice of course.


What ffmpeg and magick have in common that git doesn’t is (relatively) intuitive and straightforward arguments. They have lots of arguments, but they are otherwise simple and consistent. If I remember an idea, it always works the same and looks the same.

In git there’s always “foo”, “bar --frob” or “baz :QUUX -j” in a set of logically related operations, and neither of keywords make sense. Also every generation of git had its own ui ways, so it’s very hard to learn if it’s e.g. some reset/checkout incantation or just restore that you wanted, because when you refer to google, it never knows it’s not 2015 anymore. Some humans can’t learn inconsistent badly named things, I’m one of them. I can remember, but to actually understand I’d have to understand Linuses mind’s inner machinery, which is alien to me.


Idk which common Git commands you think are so incomprehensible or unstable between versions. Structure-wise, there's a combination of positional and non-positional arguments, but that's not uncommon on Linux. I haven't seen a major change in the way the Git UI works for the basics in the past decade, that I can recall. Of course Googling an answer to a problem can lead you off the beaten path, but I think that if you get an idea of what looks appropriate you won't be taken in by hairbrained approaches.

I think most of what you need is actually on this cheat sheet, so maybe all you needed was a reference.


> you won't be taken in by hairbrained approaches.

Hare-brained. (Hares are not supposed to be very smart animals.)


Looking at subj cheatsheet, I immediately see `git add .` described as adding ALL untracked files and unstaged changes. But deleted files will not be included, unless you pass -A / --all. But wait, that's just my memories, since git now does include removed files, according to my tests today and https://git-scm.com/docs/git-add#Documentation/git-add.txt--.... It's hard to tell if that changed in the past decade or not, cause the manual never mentions neither a version not that -A is default now in a section corresponding to -A. I still have -A in my bash aliases and it was 2017 when I finally got frustrated enough to create them.

And this complexity was literally from the first trivial thing I checked, I wasn't looking for it for hours to gaslight anyone here. Git is nice and fast as a core program, but its ui, documentation, compat and informational ecosystem are just poor.


What do you mean, "deleted files" -- removed from the git staging area with "git rm", or actually deleted on the file-system level? (I don't think it ever added the latter, did it?)


Yeah, I'd heard good things about the Mercurial UI but bounced off when "how to branch" turned up https://stevelosh.com/blog/2009/08/a-guide-to-branching-in-m... with not one but three radically different answers. Seemed somehow unfinished to me.


I wouldn't say that these features are unfinished. They're just "extra" features that don't really add anything to the experience. People who like Mercurial rationalize and say that this gives you more options, of course. I think you can't really delete named branches in Mercurial, but don't hold me to that. The one that corresponds to Git branches is bookmarks, and of course bookmarks are the last thing you ever learn about when you are picking up Mercurial.

It is kinda nice to not be able to accidentally lose a branch even if you're a low-skill Mercurial user, and that is the main selling point for most people. On the other hand, low-skill Git users lose stuff often. It's actually really hard to lose committed stuff in Git because of the reflog, but the low-skill users never heard of that and you can really have a hard time explaining it to them. The other big complaint is about `git reset` and its various incarnations. People really don't take the time to understand what it does with its various options, and when they delete their changes accidentally they blame the tool.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: