Why Git is Better Than X
whygitisbetterthanx.com
whygitisbetterthanx.com
Git just seems overly complex for all but the most sophisticated workflows. I could be wrong, but that has been my experience.
It took me literally 3.5 minutes to get Git setup using the OSX install package and fixing my .profile to include the new path. I'm very impressed.
Now if only Github had a trial membership with a Private repo...
Of course, that's just my opinion. :-) You may not even be targeting students anyway.
cheap local branching: there's bookmarks, there's named branches, and there is mq. one of the cool things about mq is that the patch queues can themselves be an hg repo. so if you're using a patch queue like you would the git index, you can 'push' that state somewhere else as way of backup. can one do that with the git-index? (if you rsync your tree, get ready to rsync huge pack files everytime they change .. see below)
everything is local: this is the exact same thing on git and hg. hg incoming means check another repo for incoming changesets. ergo it needs to contact that repo which need not be remote.
git is fast: we have our source tree in hg and git. ~10k files plus binary stuff. no one notices any difference. on windows, hg is faster.
git is small: maybe so. but you have to remember, (and perhaps understand) about git-repack and friends. hg, is like a self-cleaning oven in this regard.
staging area: if one needs such a thing, there are mercurial queues. if you dont, it's not in your way.
distributed: yes. hg is distributed. that's why it has commands like incoming.
any workflow: same thing in both.
github: http://www.bitbucket.org/
easy to learn: git is easier to learn than mercurial?
ok, now here's what i don't like about git:
storage: it's annoying to have to setup git-repacks jobs for each repo, but that's fine. the real killer for us is that it kills our incremental backup strategy. every time you repack you create a new pack file (in our case huge) and you have to back it up again. in mercurial you can back up the files that changed.
bundles: git now has them but they started in mercurial. i'm putting this down because there seems to be this perception that all the cool stuff happens first in git.
index: fine after you're a pro, but we have had accidents. learning curve is a bit strict with git.
documentation: better in hg. much better actually.
git has gone through a lot of interface changes. is cogito still in use? and then they broke renaming at one point. i'm sure these things are fixed, but we've had no such issues in hg thus far.
in the end they both rock, but i prefer hg.
Very true. Mercurial's design puts most of its non-core functionality into extensions (which are easy to ignore if you don't need them), and has a clean setup for adding new extensions. How does git handle that? I haven't looked into the git source lately.
And regarding "incoming", the article says that git has a separate command (fetch) for caching server data, i.e. if there are incoming patches, when connections are available. (According to git-fetch(1), fetch looks more like pull without updating/merging locally. Unless I'm misunderstanding things, the comparison to hg's incoming is probably a bit of a stretch.)
It would make it seem more honest if you admitted that git wasn't the alpha and the omega when it comes to version control. I think it would also show people that you've carefully thought about this and are not just a 'fanboy'.
THINGS GIT IS STILL NOT GOOD AT
* windows (all)
* large files (svn)For the curious among us: what systems handle this better than git?
Because it simply doesn't matter that much IMHO. A startup doesn't succeed or fail based on which RCS it uses, it may fail if it doesn't use any at all, and it may fail if people are wasting a large amount of time doing silly things (Moving directories in cvs).
If you're hacking open source projects however, then I'd say Git is most likely the way to go.
In git, you just create a local branch, try it out, and see if you like the results. If you do, you can have a buddy pull your new branch and see if he likes them, and if everything's good, merge it into master. If you don't, just delete the local branch and nobody's the wiser. Also makes for really quick commits while you're trying things out.
My favorite story when we worked with a college thousands of kilometers away till the last minute to demonstrate a key feature to a customer at a trade show, exchanging revisions by emails, delivered on a USB stick. That's a real technology start-up way to handle development. I wrote and debug a lot of code to that company but my biggest impact was to introduce mercurial to the team.
But you are making a statement not using good tools and it might be harder to get good hackers.
Is that really true? I might just be dumb, but I had a harder time with git. Given that I'm in mostly single-user mode, it seems like I might be more productive with svn simply because I wouldn't have to wrestle with it as much to get going.
Can anyone recommend a "git for people who can understand and operate svn without hurting themselves?" guide? Or is the value of git significantly lessened in single-user mode?
I think part of my problem might have been that I tried to learn Git using Github, which made a multi-user situation out of a single-user situation and was unnecessarily complex. For my current project, the source is not public so I can't have that problem ;-)
However, I would still invest the time to learn git, and yes it is more complex then svn.
Like 10 fingered typing git is something you don't necessarily need, but it is a multiplier on your productivity.
http://git.or.cz/course/svn.html
http://cworth.org/hgbook-git/tour/
http://www-cs-students.stanford.edu/~blynn/gitmagic/index.ht...
Branching is a killer feature, as is clean history management, as is the index, and when you find yourself wishing more control over what happens to your source code, wishing for freedom to experiment, all these tools will be there waiting for you.
Except it's not, since it'll output different things depending on whether you have staged anything or not.
This behavior is sometimes useful, but hardly obvious. Many aspects of git are like this, and it's frustrating, speaking as someone who slowly came around to git and now likes it quite a bit and would recommend it, to see its advocates forget or try to talk around just how difficult it is to learn. (1.5 and 1.6 may have improvements, but the claim that git's now roughly as easy to learn as hg or bzr, especially without understanding its internals, is absurd.)
Also, I don't know what crack they are smoking but Perforce is easier to learn than Git for basic stuff. The biggest place that I've seen perforce get complex is where people try to enforce all sorts of bizarre (read: stupid, useless) polices.
I had postponed this moment as long as possible using the svn-without-branches approach. But that wasnt going to help me going fwd. That night I figured I had no choice but to plunge into git asap. I was not looking forward to it AT ALL; It seemed at best a necessary cost.
Once I decided to, it took me under 3 days to mostly "get" git and be productive. (And I would not say I am the quickest learner.) Now I would never, ever, ever go back, even for tiny projects.
Key resources for me: - gitcasts for the basics - git channel on IRC for odd questions - git internals from peepcode for a more solid understanding
Best of luck!
But once you grasp that, it's pretty easy, not to mention pretty powerful. For me, Git had certain features that gave me a "wow", as I learned about and got use to using them:
1) Local branching - branching is fast, and merging is relatively painless. This lets you experiment with things without affecting the main branch. Branches are like 'tabs' on my browser, but for my source control. git checkout -b experimental_branch
2) Staging commits - You can fix little things that might not have to do with your current ticket, but add them to separate commits. You can do even split edits done to the same file to two different commits. git add -i
3) Rebasing branches - You can move the root of the local branch if you want the changes since then. Even better, you can reorder the commits as long as you haven't pushed it to a remote repository yet. The same task allows you to squash your commits together for a cleaner history. git rebase -i
4) Stashing changes - You can stash uncommitted changes, so that you can perform other operations that require no uncommitted changes. This is useful when you're working on something, but can't commit it to your local branch yet, and something needs fixing on production right now. git stash
Basically, a lot of what Git enables me to do is switch between tasks easily.
As a single developer, I love this about git. Being able to instantly create a new local branch to work on something, even if I only have an hour or two to devote to it, then switching branches and continuing on with the next important task is awesome. At least for me, it basically encourages exploration and testing new ideas because it takes no time and I know the "real" code is still safe and accessible instantly.
Still, I'm sure it won't be long...
I'm working on a Git GUI that should be fairly beautiful (I'm a former graphic designer), but there aren't really any good GUIs out there right now.
If you do decide to use some sort of VCS, svn has some great GUIs.
like Versions (http://www.versionsapp.com/), Cornerstone (http://www.zennaware.com/cornerstone/) or ZigVersion (http://zigversion.com/).
Versions is nice because it can easily integrate with their hosted subversion stuff called Beanstalk.
I know git performance is much much better than bzr but as thats not a major concern for small/medium projects, could someone who has used both bzr and git give some pointers on what one would be nicer to use than the other in areas other than performance?
Mark Shuttleworth wrote a series in his blog about what he cares about in version control, and why he picked bzr for Ubuntu and Launchpad, which is an interesting counterpoint to the git lovefest we've been seeing here.
you can see the network activity here : http://github.com/schacon/whygitisbetter/network - all of which has happened since I posted this news item 2 hours ago.
Furthermore, I have been using Git since the pre 1.0 days several years ago - way before most people were using it, so 'fanboyism', a term that I hate, is obviously not why I use it or why I try to teach it. I feel that it is a legitimately better choice for most people than these other tools and this is my attempt to make those points as simply and as straightforward as possible. If you feel I am technically incorrect on anything, please email me and I _will_ fix it.