I Can Haz Hardcore Forking Action
Recently myself and a few co-workers (@davemerwin, @bradpitcher, Percy and Nate) got together for what we called, "Django Night: 3 Hours 1 App", in which we attempted to build a website from start to finish in 3 hours using Django. We also decided to learn and use Git and GitHub as our decentralized source code management. This is more about the experiences learned from Git than the Django project.
What is Git
Git is a distributed revision control / software configuration management project created by Linus Torvalds, initially for the Linux kernel development. For more from Linus himself, this is an excellent and entertaining video, Linus Torvalds on git.
I haven't used git for long, but it is changing the way I think about programming by not worrying about going down a dead end path with my code -- simply branch it and experiment. If the branch works out, merge it in with the main branch. If it doesn't, no big deal, delete the branch and start back where you were. Here's a nice list of why git rocks:
- Git is distributed -- code forking allows for many people to work on their own self-contained repositories, sharing full code history between each other.
- Git is distributed -- you can work and commit offline which is a great advantage for laptop users, and push all your history when you're back online.
- Git makes branching and tagging extremely cheap and convenient.
- Git makes merging a trivial yet powerful operation and was one of the main design considerations. This is the part that changes the way you think about programming.
- Git is safe and reliable -- if a file becomes corrupted, git will let you know since all code is checked with SHA1 checksums.
- Git allows for cryptographically signed commits.
- Git is highly optimized for drive space.
- The people in the IRC channel #git are very helpful and friendly.
What is GitHub
GitHub is a git project hosting website with great git integration. It is currently in beta but is fast becoming a great git hosting solution complete with code browsing with syntax highlighting, history viewing, and soon issue tracking and more.
One of the most interesting ideas to come out of it, as pointed out by Ryan Tomayko, is the networking aspects of code forking. Git is all about forking code and pulling changesets between various forks or branches, but what GitHub adds is a viewport into those who forked your code and visually seeing the changes they're making. Your code develops a social network all its own. On our first Django Night we were so excited with all the "hardcore forking action", what GitHub reports when you fork someone's project, that we got a late start on our Django coding!
Reasons why GitHub rocks:
- It hosts git repositories, naturally, and since git rocks, so does GitHub.
- GitHub makes it super easy to use the social aspects of git (forking, pulling changesets, etc.)
- Because of this, GitHub actually encourages a more active coding style and cross pollination of code.
- GitHub offers free hosting for open source projects.
- Did I mention that git and GitHub's social nature really changes the way you think of programming?
- The people in the IRC channel #github are very friendly and helpful, even going as far as answering general git questions which should technically be asked in #git.
Summary
In summary, we have had an enlightening evening that has changed the way we think about our coding practices. And we're all switching to using git and GitHub personally. I encourage everyone who is interested in the future of coding to give git a try, and sign up on GitHub (via an invite or when it launches) and share your code.
