←back to thread

1062 points mixto | 4 comments | | HN request time: 0s | source
Show context
dijit ◴[] No.42941702[source]
Well, what's terrifying is that the guide is so long.

I am aware that beej's guides are typically quite comprehensive, but the vast nuances of git truly eluded me until this.

I guess Jujitsu would wind up being a much slimmer guide, or at least one that would be discoverable largely by humans?

replies(3): >>42942124 #>>42942687 #>>42943687 #
vvpan ◴[] No.42942124[source]
It tells me that git is the wrong tool for the majority of people but it just happened to stick.
replies(3): >>42942293 #>>42942401 #>>42952448 #
stephen_g ◴[] No.42942293[source]
I think it's probably the opposite, Git has amassed a lot of complexity because it's been adapted to being a tool that is able to can satisfy the majority of requirements.

I've never found that I need to touch most of it in the 15 or so years I've been using it, but it's there if your project needs it.

replies(2): >>42944590 #>>42945028 #
1. riffraff ◴[] No.42944590[source]
Git was always confusing to use. There's a reason it has gained a "switch" command, and that's because the "checkout" command was confusing, while being there from the beginning.

Probably you've been using it for ten years or more at this point and have internalized it, but when it came out git felt way more confusing than other VCSs.

Compare git diff with hg diff for example.

replies(2): >>42947350 #>>42948892 #
2. account42 ◴[] No.42947350[source]
I've never been confused by git checkout. git checkout <branch> switches to a branch. git checkout <commit> switches to a commit in a detached head state. git checkout <file> switches just the content of a file. You can also combine these ofc but it all works pretty much as expected. The -b switch for creating new branches is someting you need to look up once and then just remember - and it does make sense - you are switching to a new branch.
replies(1): >>42954330 #
3. imcritic ◴[] No.42948892[source]
Git is wrong in some regards: they introduce an entity "branch", but it is not stored properly, it's like virtual data.

The proof that there are really no branches in git's storage is a simple task that's not achievable in git:

suppose you had some branch, but you don't remember it's name, then you branched off and issued some commits. Now there's no way to get a git history consisting of just the commits introduced since you branched off.

4. riffraff ◴[] No.42954330[source]
I've dealt with people who are new to git and the fact that "git checkout X" does one thing or another based on what X is, was confusing for them, even if I could find an explanation for it. If you didn't have the same experience, good for you!

But compare "git switch X" and "git restore X". This makes different things look different, and obvious, which is usually a valuable thing when learning a new tool.