Comment by jimktrains2
7 years ago
I think git provides a sane level of abstraction.
I don't think it provides the most consistent UI or helpful help, though. Once you move away from "learning git commands" to "learning how git works" and kind of figuring out which parts the commands refer to has helped also. That's still terrible though.
>I don't think it provides the most consistent UI or helpful help, though.
Understatement! Git is one of the most user-hostile tools I've ever seen. And I've used Sendmail.
Just read the manual.
https://git-scm.com
Most of the abstraction is fine. The staging area model is a total mess though. The way that staging interacts with other commands (e.g. stash) is constantly surprising.
Git stage is "These are the things I'm planning to do", and git commit is "OK now do these things". Lots of carpenters draw plans before they start cutting but we don't think that's so hard do we?
I had trouble with Git until I discovered "git add -p".
I'll grant that Git could do with a revision of its commands and args.
The issue isn't with the level of abstraction, but with the side-effect based workflow of some of the more common commands. The most visible of these is unstaging a file.
The syntax is "git reset -- <file path>". What does that do? Well, it tells git not to change the head pointer. Of course, it wasn't going to do that anyway, but as a side effect of not doing anything, it makes a decision about what to do with all the staged files. The default resolution is to unstage everything so that everything that happened between the old head and the new head can go in the stage. When you add the "--", you're telling it to only apply that resolution to the specified files.
So what you're actually telling Git is, "don't do anything, but when you don't do anything, move these files out of the stage so that you have room for all the files that you're not going to stage."
And this is why I used Git for an entire year without actually knowing what "git reset" does.
1 reply →
> Git stage is "These are the things I'm planning to do", and git commit is "OK now do these things". Lots of carpenters draw plans before they start cutting but we don't think that's so hard do we?
But when a carpenter stashes and unstashes their things, they don't suddenly find out they're magically planning to do a lot of things that they weren't previously planning to do.
1 reply →
> I don't think it provides the most consistent UI
That reminded a video where Linus Torvals is been interviewed and he says that if he ever have to make good UI to get out of a desert island, he would die there.
http://stevelosh.com/blog/2013/04/git-koans/
I find the only people who find Git to be confusing or frustrating are the ones that try to adopt complex workflows. I've taught marketing and creatives to use Git with no issues.