Git vs Svn
I’ve been hearing a lot recently about “git vs svn”, as though one had to replace the other.
Recently I started reading up on Git for work, and trying it out on a couple of personal projects. It uses a very different development model; I think its not so much a question of “which is better” but “which model better fits what you do?”
svn’s model:
- Fixed group of trusted developers
- Centrally track all changes
- Can control read or write permissions per subdirectory, although write access is required to merge a change back to trunk
- Is against casual rewriting of history; if it happened it happened. You can undo the mistake but a record of it is always there. This is especially handy for providing evidence of IP ownership, and if you release often (eg, using a SaaS model), you can always check on old mistakes to see if they are relevant to a support ticket.
- Each change is pushed to the central server, so users get each others changes more quickly. Some say this is slow; that hasn’t been my experience.
- A merge is applying (typically) all changes to a branch at once, if you want finer detail you’d go back to the history of that branch
git’s model:
- Each user gets a full copy of “history”
- History may be rewritten to just “added this feature”, skipping mistakes.
- Many operations are faster because the information required is all local
- A merge is merging histories, and often followed by complete removal of the old branch
- A “push” to a central authoritative source just pushes your history into a special “pending approval” area, requiring the owner of that central repository to merge changes into the official line.
- ‘Permission’ is managed in a “anyone can take a copy of the whole thing, and make any local changes they want, and what they contribute back must be approved’ model.
As I see it, the development models are different. Svn assumes a small trusted team, and that you don’t want to have to approve other people’s changes, you either give them permission to do it or you don’t. Git assumes a wider contributor base and needs a captain (or “trusted generals”) to approve changes.
You can use both git and svn together (many people do, it gives an ‘authoritative source’ from svn, plus the ability to make local edits that never count if you don’t want them to)
Which tool is better, to me, depends on the nature of your group and how open the project is.
Of course I am new to Git and could be missing some things; feel free to comment.
Please give comments in your own webspace so that I don’t have to moderate them; paste in gitsvn357E84 to your blog post or twitter comment etc, and I’ll find it via: http://www.google.com/search?q=gitsvn357E84
0 Comments
Please use the DP Forums for further discussion of this topic.


