←back to thread

1062 points mixto | 2 comments | | HN request time: 0s | source
Show context
scrapcode ◴[] No.42942555[source]
I can't help but feel that Git has completely missed the forest through the trees that you can make a 30+ part guide explaining how to use it.
replies(6): >>42942641 #>>42942672 #>>42942768 #>>42943372 #>>42950299 #>>42954886 #
ajross ◴[] No.42942768[source]
My sense, bluntly, is that if people spent half the effort learning git that they do whining about it, no one would bother making a 30+ part guide just explaining stuff you could find in a man page.

Commits are snapshots of a tree. They have a list of ancestors (usually, but not always, just one). Tags are named pointers to a commit that don't change. Branches are named pointers to a commit that do change. The index is a tiny proto-commit still in progress that you "add" to before committing.

There. That's git. Want to know more? Don't read the guide, just google "how to I switch to a specific git commit without affecting my tree?", or "how do I commit only some of my changed files?", or "how to I copy this commit from another place into my current tree?".

The base abstractions are minimalist and easy. The things you want to do with them are elaborate and complicated. Learn the former, google the latter. Don't read guides.

replies(7): >>42942804 #>>42942870 #>>42943548 #>>42944155 #>>42944541 #>>42946116 #>>42946888 #
globular-toast ◴[] No.42946888[source]
There is one fundamental piece missing in your description of git that I think is the main reason people don't understand it. You have described a single DAG, but in git there are multiple DAGs. This is what it means to be a distributed version control system.

In my experience people come to git and start using it with the centralised paradigm in their heads: that there is one repo and one DAG etc. They think that their master branch is the same as "the" master branch. You just can't get good at git with this wrong understanding.

replies(1): >>42955057 #
1. HdS84 ◴[] No.42955057[source]
My problem is that I always use git as a central server. Except that one time when our internal git was down and we used it peer to peer for a day. Honestly, using USB sticks for that would also have been okay.
replies(1): >>42962353 #
2. globular-toast ◴[] No.42962353[source]
> Honestly, using USB sticks for that would also have been okay.

Right! People often forget git was designed specifically for Linux kernel development which is done by a loosely-knit global base of developers. There are much simpler solutions if you can actually live with exchanging USB sticks.

One nice thing is only needing to know one tool for both open source and centralised development, though. It can seem a little odd if you don't do any open source at all, though.