Hacker News new | ask | show | jobs
by ngruhn 68 days ago
I don't even think git cli UX is that bad. Didn't git pioneer this sub-command style? Much better than like e.g. ffmpeg. Sure some aspects are confusing. I still don't understand why `checkout` is both for changing branches and clearing uncommitted changes. But overall I think the tool is amazing. I've not observed a bug in git once.
3 comments

> I still don't understand why `checkout` is both for changing branches and clearing uncommitted changes.

Because `checkout` is for getting the working directory to the state of a specific revision. Which both means switching branches (which are just pointer to revisions) and clearing changes (and get back to the starting revision). In both cases, you "check out" the version of the file at a specific commit or HEAD.

> Didn't git pioneer this sub-command style?

No, various other tools used it before git, e.g. openssl.

sure but it certainly popularized it
`git change` can switch branches too if thats easier to grasp :)