Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> You have your own copy of all the branches which you are free to do whatever you want with.

That's the default. But git would work just as well, if by default it was only cloning master, or even only the last few commits from master instead of the full history.

You can get that behaviour today, with some options. But we can imagine an alternate universe were the defaults were different.

Most of what you say, eg about not needing lockfiles and being able to make independent offline commits, still applies.



The point wasn't really about having your own copy of the commit history, it's about having your own copy of the refs (which is all a branch is in git). Basically, your master branch is not the same branch as GitHub's master branch or anyone else's. This is one of the things people don't really seem to understand about git. It means you don't have to do the "feature branch" thing, for example, you can just do commits on your master branch then submit a PR.


Yes, branches are just mutable pointers. The commit history is an immutable tree and has a garbage collector to clean up.

Funny enough, this is more or less exactly the architecture some of those Haskell-weirdos would come up with. It's essentially a copy-on-write filesystem.

(Haskell people are weirdos compared to good old fashioned operating system people who use C as God intended.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: