12 ms·
I've never had problems with git "not mapping" to my mental model of what I'm doing, so maybe you could help expand on what that means. But I've run into two ca
by jbhouse 6y ago
I've never had problems with git "not mapping" to my mental model of what I'm doing, so maybe you could help expand on what that means. But I've run into two categories of people that struggle with git
Novice developers that just haven't taken the time to learn more than three basic git commands. Their lack of knowledge is the problem 99.9% of the time, but they don't know enough to know they are the limitation, and they blame the tool instead
Old developers that come with a mental model of another VCS and either cannot or will not change their mental model and continue to be frustrated that they weren't consulted when git was designed
A third category may exist, but I have not met these people IRL
- tootie 6y agoGit tooling has improved dramatically and papers over most of the confusing parts. The biggest flaw by far is the opaque command line rules. There's a reason "how do I undo a commit?" has >20000 votes on StackOverlow instead there being like "git undo" or something obvious like that. There's dozens of Qs like that because it's so far from obvious. A lot of git purists in the early days insisted on uselessly complex workflows (rebase this and bisect that) despite adding little value. And the general concept of staging a commit isn't very useful either. https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git https://stackoverflow.com/questions/927358/how-do-i-undo-the...
- mjw1007 6y agoSupposing you have an accurate mental model of what git does, the odd thing is that many of the most common commands don't correspond to simple operations on that model. Most notoriously, 'checkout' and 'reset' have a number of very different behaviours depending on the shape of the parameters you give them (which is why they've very recently added 'switch' and restore'). And some things that ought to be primitive operations don't seem to have any simple command at all. For example, if I have branch 'wip' checked out, and I'd like to advance branch 'dev' to point to the same thing as 'wip' without changing the currently checked-out files (even temporarily, because I don't want their timestamps to update). And the preferred commands for managing the per-branch and per-remote push and fetch and merge settings have changed so often that I gave up years ago and just edit .git/config directly.
- javajosh 6y agoThis. A lot of the responses in this thread seem to conflate git commands with the git idea. The idea, which is to model a tree of files as a set of objects that contain metadata pointing to content-addressable files, is a very good one. The commands are very bad.