Monday, April 13, 2009

Distributed Version Control & Git [Part 1]

dvcs.png
This is a video based off a talk I gave on Distributed Version Control for the Des Moines Cocoaheads and gave an example of how to use it in the context of git. The premise of my talk was showing why you should switch to distributed version control and showing off some cool things it can do. Today I seriously believe that with few rare exceptions do we really need centralized version control, in addition Subversions merging is broken and these distributed systems tend to do branching & merging in a much more pleasant manner that actually makes things enjoyable. Literally when you start using Distributed Version Control you tend to start making a lot of branches and do many more merges, it becomes you do commits and merges when you want to vs doing them in some regularity because you fear your version control system might make things harder if you don't commit or merge now. Check in later for Part 2 where I demonstrate some features in git in another screencast... for now here are some things to get you started Git Homepage The way I'd recommend people install Git Git OS X Installer (Google Code Project) Git Cheat Sheet Gitx App Pragmatic Programmers: Pragmatic Version Control Using Git [Book] Linus Torvalds Google Tech Talk on Git Randal Scwartz Google Tech Talk on Git

6 comments:

Anonymous said...

Would you mind to share some insight on how to (best) work with git submodules for stuff like shared code or bundles?
There's not a single tutorial out there that deals with cross-(xcode-)project code management.
This would be great, keep up the great work!

Colin Wheeler said...

Anonymous, I might try sometime, I haven't dealt with git submodules that much, but I'll put it on my to do list :)

Yann said...

The concept of distributed CVS rocks. But, in my humble opinion ;
if you are a pragmatic programmer you use Bazaar (http://bazaar-vcs.org/).

The easiest to learn distributed version concurent system.

A DCVS must no be in your programming path. You should simply use it to have a better productivity. You have to use a tool that let you focus not on the tool but on your programming. And I believe Git is the worst choice to take. It is the most complex and difficult to learn.

Bazaar has a very good learning curve, it is efficient and used by all the Ubuntu community. Never had a problem after the 1.0 version (1 year ago).

Another good choice should be Mercury. But definitively not Git. Git was not intended for normal application but for the Linux Kernel which is HUGE!

Colin Wheeler said...

Yann

I disagree with you a lot on several things

(1) git it very easy to learn, it's not hard to pick up at all anymore than mercurial or bazaar

(2) Bazaar in my opinion has horrible branching, it tries to be like a distributed Subversion and largely follows the same directory layout structure that subversion uses in making directories and then telling bazaar that those directories are branches. That's okay if you only like the Subversion model, but many don't and in my opinion only Git and Mercurial do this branching model right of the 3 main DVCS's where you just have your project directory and you switch branch containers which makes things much simpler, I don't want to deal with directories, just branch names.

Git was designed for a massive project (the Linux Kernel), but that means nothing, the only thing that matters is how easy is it to use and git is very easy to use and pick up. Mercurial is the same as well as Bazaar. Lots of massive projects use git and mercurial as well as lots of small projects and even 1 man projects like the ones I and many others do, the size of the project the DVCS is completely irrelevant, it only matters how well it works for you.

That's all I have to say on the matter for now.

Yann said...

Hi Colin,

ok, when I choosed Bazaar (for a team which is not even happy with normal versionning system), I made my view using :
http://bazaar-vcs.org/BzrVsGit

and many other post stating that Git is far easier to learn.

Just after the speak of Linus about Git I was enthousiastic.
But at that time, the Git documentation was far more difficult to understand than now. Further more at that time DCVS was a new concepts.

This is why I prefered Bazaar but you convinced me to give a try to Git. My only problem is I'll cannot use it at work (I hate windows).

I had now viewed this website:
http://whygitisbetterthanx.com/

and know that git can merge 2 branches without any common ancestor (which bzr can't).

regards.

jelmer said...

Yann, Bazaar has no problems merging two branches without common ancestors, use "bzr merge -r0..-1 other-branch".

 
...