bad_username
5 hours ago
I was uncomfortable with git until I read (the first 3 chapters of) the pro git book ( free here : https://git-scm.com/book/en/v2 ). It provides a great mental model of how git works under the hood. The UI of git - for better or worse - directly reflects its internals. And when I understood them, everything clicked into place.
Hendrikto
3 hours ago
Git is not nearly as confusing as people make it out to be. They just never take the few hours it takes to understand it. Which is a sad state of affairs for such an essential tool in the belt of any software engineer.
git commit -am “Changes”
just does not cut it, if you call yourself a professional.hackrmn
2 hours ago
My observation has been that those who have never learned Git properly -- disregarding for a moment the issue with what "properly" means here -- just don't think they need to, sticking to very simple workflows that produce linear graphs featuring squash-rebased work throughout. Because they don't know Git's fundamental model (including what you'd think was the obligatory piece of information that commits are essentially immutable), they don't venture farther than their confidence suggests, keeping it within the circle so to speak.
The tragedy, if you ask me at least, is rather that they then start imposing the "keep it simple" culture onto everyone else, which frankly turns Git into what SVN and CVS were accomplishing before it, with all the drawbacks of those. This keeps 90% of the team satisfied 90% of the time because there's nothing wrong with strictly linear graphs and the pro's that are asked to produce these, can always squash-merge their intricate local development history before they push to Github (which some Git users also think is part of Git proper).
Something about using Git in the aforementioned way just bugs me strongly. I admit it's a me problem, very likely, but lately I've also had to admit that it's not just that either.
For instance, if I need to fix a bug I use `git blame` to find the commit where I have learned the bug originated. I do a `git checkout -b ... <commit>` to start working on a fix, creating a branch starting at the problematic commit. Already that is head and shoulders above what many people I work with do or know _what_ does (or why would one want to do that).
I do it because it creates a _trail_, certainly more so than just committing on top of `master`, even with a good commit message.
But my practice doesn't produce linear graphs, even as pushed to Github (which we have to use, for better and for worse) and shared with everyone. I then get people coming to me and complaining they can't merge and it becomes obvious they don't understand Git sufficiently to do anything else but `git reset --hard` or worse, `rm -rf * && git pull` and hope for the best.
Not sure where I was going with this, something about why use Git when it's the new SVN with everything SVN had and none of what SVN didn't have...
nixon_why69
an hour ago
Ok but the final outcome, most of the time, is a linear graph unless you're maintaining extremely long-lived branches for some reason.
Setting practices so that linear graph will be easy to understand in history is still a good idea, no? I'm not religious about squash-merge on master but when I look at master's history, I'd expect each individual commit to have a good message and be releasable.
hackrmn
an hour ago
A linear graph doesn't do any developer in the team except Github (which isn't a developer in this context) any good because they have to pull down the graph at some point and when they have to fix something, although they will be able to track the blame to some commit in the middle of the graph, when they fix it and merge it it has to be squashed again (by hard or soft enforcement), which like I said negates much of the point with Git -- there's no usable history left.
Point being that branches aren't something to avoid, implying that complicated graphs are not to be avoided either, but embraced and knowing how Git works it's not a problem at all (unless your "bush" is accidentally complex in a bad way) -- except that if noone bothers to learn Git, it _becomes_ a problem, solved at the cost of the value that Git provides -- branching (not just ephemeral branching for your local convenience). Exacerbated by Github since everyone pulls from there -- meaning that production-grade code is not a true graph but a linked list, on average.
nixon_why69
38 minutes ago
> the value that Git provides -- branching (not just ephemeral branching for your local convenience).
I think this is the disconnect. I could see big libraries maintaining branches for each major release and I understand why linux does it. But if I'm maintaining FooService at work then I actually do just want a linear graph of all the commits that have been in production, in commit order.
hackrmn
12 minutes ago
If you want that, mandate developers use prefixes like `!fixup` and do `git rebase` _on your end_ -- why force upon everyone your ideas especially if it also squashes all development history? This also removes development friction because people can work with Git on their end the way they like without regard to some convention that can be avoided -- save for the "!fixup" thing which can be considered useful metadata.
kreco
2 hours ago
> Git is not nearly as confusing as people make it out to be.
The people are confused, it's a fact. So it is confusing. Stop gaslighting people.
xelxebar
an hour ago
Interesting. "A is X" is different than "I experience X from A". The former employs an objectivist lens while the latter a subjectivist one. I have had the pleasure of witnessing debates about whether a room really, truly is cold or not, which all resulted from a simple "it is cold in here" comment. In my experience modern English speakers tend to bias toward the objectivist register while Japan tends the other way. One of the joys in my life is how absorbing languages and cultures elucidates previously-unperceived distinctions. This discussion makes me want to try picking up Ithkuil again.
/r
ninkendo
an hour ago
There’s this important word in the sentence you seem to be ignoring: “as”
GP isn’t saying “git isn’t confusing”, they’re saying “git isn’t as confusing as people make it out to be”
The point being, people exaggerate git’s confusingness when discussing it. There’s an element of irrationality here that’s worth bringing up, especially when it comes to comparing it to competing software. Once it has a reputation for being confusing, you’re more likely to be scared of certain workflows, you avoid them, and the problem compounds. Similarly if a VCS has a reputation for being “simple”, people might gravitate to it, learn it first, then parrot conclusions that git is too complicated because they never really gave git a chance in the first place (often they do take the time to read the other VCS’s documentation, and if they would have done the same for git they would have had no problems.)
It doesn’t help that there are so many bad tutorials out there that simply give you what commands to run, and tell you dumb stuff like “just make another clone if you get stuck”, and that makes the problem so much worse, and isn’t git’s fault.
Git is a bit confusing sometimes, but it’s mostly for reasons like “the reset and checkout commands do too much”, and “some low level commands are easy to confuse with high level commands” not because it’s a fundamentally confusing tool.
kreco
an hour ago
> Similarly if a VCS has a reputation for being “simple”, people might gravitate to it, learn it first, then parrot conclusions that git is too complicated because they never really gave git a chance in the first place (often they do take the time to read the other VCS’s documentation, and if they would have done the same for git they would have had no problems.)
I don't think I need to reply to a comment that illustrate the main point of this sub thread.
ninkendo
an hour ago
You just did though…
Maybe try and explain in more than one-sentence quips why you think git deserves its reputation? Otherwise you’re just coming off as a bit of a troll. Have a nice day.
xeyownt
2 hours ago
If you ignore gravitation, a sphere earth can be very confusing.
dspillett
2 hours ago
But not as many people are as confused as is sometimes made out. And those who are confused are not as confused as people make out¹. Implying that a great many people are very confused because some are is far more gaslighty than suggesting it isn't that hard in the majority of circumstances, IMO.
--------
[1] many (and I'd include myself here) are fine using the basics, perhaps with some less as-simple-as-possible workflows, but might need to scan the docs if they hit a conflict merging two branches that have developed independently for a fair few commits and have overlaps
Thanemate
2 hours ago
>The people are confused, it's a fact. So it is confusing. Stop gaslighting people.
I don't think this sort of aggression is warranted, as the fact that I find something confusing doesn't directly imply an intrinsic feature of the object that I'm confused with. One can reach that conclusion by observing that, not everyone who learns about the object finds it equally confusing.
All that to say: "The people are confused" doesn't mean that "All people are confused".
kreco
2 hours ago
There is no aggression.
If your product has a reputation to confuse users compared to other products, your product confuses users.
Let's not start to bend reality just to back up some narrative because after reading a N hours documentation everything is OK.
dspillett
an hour ago
> Let's not start to bend reality just to back up some narrative because after reading a N hours documentation everything is OK.
If you expect everything to be as easy as pie without needing to make a little effort to read a bit of documentation, then perhaps the problem is not the product but the fact that you are in the wrong industry, or the wrong role within that industry, for you. Have you considered a management track?
Git is intended to make certain patterns possible, and practical. “Easy for people won't read some documentation” was never one of its design goals.
kreco
an hour ago
You conveniently cherry picked the least relevant part of my message.
No one said everything should be easy as pie.
There are other software similar to git that have not such reputation. Version control is not new.
account42
37 minutes ago
> There are other software similar to git that have not such reputation. Version control is not new.
Yes, there are alternatives that aren't used by anyone except dedicated fans. If they had the wide user base that git enjoyed you'd hear just as many complaints about them.
jamesnorden
an hour ago
Because people actually use Git instead of whatever you mean.
kreco
an hour ago
This is irrelevant to the topic.
I didn't ask why git was widely used. I didn't say git was useless.
Again, there were version controls before git came out.
echoangle
42 minutes ago
I think the point was that a lot of people are confused by git because a lot of people use it. Meaning that the other software where people don’t complain would get the same amount of complaints if it had as many users as git has.
ninkendo
an hour ago
> If your product has a reputation to confuse users compared to other products, your product confuses users.
Is your contention that all reputations are deserved, by definition? That’s certainly an interesting take. It leaves zero room for the concept of an “unfair reputation” for example. Maybe you should rethink your argument here.
hnfong
4 hours ago
Same here. The git commands were confusing to me until I actually saw a Linus video on youtube explaining how the git data structures worked under the hood. It was dead simple, and one could easily mentally map the tools' functions onto how they operated on the data structures.
Once I understood that, as you said, everything clicked into place.
Somehow the "higher level abstractions" that git tries to do makes the things ever so more confusing.
xyzsparetimexyz
5 hours ago
No it doesn't. Half the git commands are low level, half are high level. It's not 1:1 at all.
palata
5 hours ago
So when someone tells you "understanding X helped me a lot", your answer is "no, it did not"?
> It's not 1:1 at all.
I don't see any mention of "1:1" in the parent.
debugnik
4 hours ago
They're replying to
> The UI of git - for better or worse - directly reflects its internals.
palata
2 hours ago
> Half the git commands are low level, half are high level.
Can't we say that the low level level commands reflect its internal? ...
jesse_ash
4 hours ago
> The UI of git directly reflects its internals
Maybe?
vasco
4 hours ago
Mercurial had by far the best UX, never had to read anything to learn it. I just pretend that I'm using mercurial when using git and nuke local repo if I mess up. Been doing it for my whole career.
black_knight
4 hours ago
I love darcs! Somehow its interface just vibes with me. It is interactive by default, and the commands like “record”, “rollback”, etc, are somehow intuitive. Darcs also tried to put more semantic content in the patches, like file operations or search replace parches.
It is always satisfying to rename something, then merge in some work where someone used the old variable name in the meanwhile, and the merge would go through automatically applying the rename!
yurishimo
4 hours ago
I've often found that many problems when working in teams can be traced back to `rebase`. I understand the benefits, but if you're already working on a team where history is not used in any serious way, then you cut out a lot of foot-guns by only using `merge`.
Hendrikto
3 hours ago
> if you're already working on a team where history is not used in any serious way
Then you are doing it wrong. Sadly this is very common.
zwischenzug
3 hours ago
Except the "merge mess" footgun.
I got into training people in Git (I now do it for O'Reilly) because I worked with 12 teams that merged _everything_ into sub-branches. The result was that the `git log --oneline` command resulted in screensful of just pipes.
My initial training goal in training was getting my students to understand a rebase to avoid that mess.