# Can someone explain Git to an SVN user?

**URL:** https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687
**Category:** Factual Questions
**Created:** [June 16, 2011, 2:06pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687 "2011-06-16T14:06:05Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![iamnotbatman](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@iamnotbatman](https://boards.straightdope.com/u/iamnotbatman)
#### Post date: [June 16, 2011, 2:06pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/1 "2011-06-16T14:06:05Z")

</div>

I am familiar with SVN and CVS, and I’ve been hearing a lot about [Git](http://en.wikipedia.org/wiki/Git_(software)) lately. What is so special about it? Reading the Wikipedia page is frustrating, because while it quotes Linus regarding just how awful he thinks SVN is, I can’t figure out what in practice is the core difference. How would Git make my life easier (aside from speed, although I’ve never thought of SVN as slow)? Articles also seem to mention how Git is “not dependent on network access”, which makes no sense to me. Obviously any versioning system will require network access to sync changes with others. There must be some simple way of explaining what the difference is in practice.

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [June 16, 2011, 2:24pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/2 "2011-06-16T14:24:24Z")

</div>

Once you start using git, you’ll realize how slow SVN really is. 🙂

The primary advantage to git (and also the thing that is hardest to learn) is its totally distributed nature. Subversion and CVS require central repositories from which everyone downloads the code and to which everyone sends changed code.

Git has no central server or repository; everyone has a complete repository on their local filesystem and changesets can be pushed to anybody else’s repository. This means you can check in changes frequently “offline” – check in a change every time you edit a single line if you want – and you don’t generate any network traffic until your work is complete and you send the changeset somewhere else.

As a practical matter, most projects will designate a given repository as “official” and all changesets will migrate there eventually. If you’ve only got a small group working on the project then the model will probably not be too different from SVN.  
Git also supports extremely cheap branching (svn requires a copy, and while this is still a copy-on-write, it can be painful for large repositories) which makes it easy to experiment in different directions while maintaining a complete revision history. If the experiments don’t work, it doesn’t matter, you just don’t push that branch anywhere and nobody has to see your stupidness.

I recommend [this tutorial](http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html) which comes with the git manpages for getting started.

---

<div class="post-metadata">

### Author: ![iamnotbatman](https://avatars.discourse-cdn.com/v4/letter/i/858c86/32.png) [@iamnotbatman](https://boards.straightdope.com/u/iamnotbatman)
#### Post date: [June 16, 2011, 3:02pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/3 "2011-06-16T15:02:56Z")

</div>

Sounds really cool, especially the cheap branching, but it also sounds like a total nightmare to maintain some kind of stable HEAD version, and to prevent runaway forking. This is the part I still don’t get.

As a simple example, say you have three people modifying one file, and once a week the file needs to be compiled and executed at midnight. Bob, Alice, and Phil all have forked off to conflicting versions. By the end of the week they will need to merge their versions into a stable tagged version. Since there is no central HEAD, it seems unnecessarily confusing and even politically difficult (whose changes go in first, who decides conflict priority?). Something of a Mexican standoff. It seems like it could only get worse as the project gets larger. Am I missing something?

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [June 16, 2011, 3:23pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/4 "2011-06-16T15:23:11Z")

</div>

While there doesn’t _have_ to be a central repository, nothing stops you from saying “this over here is the official central repository” and making sure everybody checks their stuff into it.

Git’s diffing and merging is very good, and it can deal with multiple changes to the same file easily. If there are conflicts (two people editing the same part of the same file) then those will have to be resolved manually, but that’s true of any revision control system.

---

<div class="post-metadata">

### Author: ![Superfluous\_Parentheses](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Superfluous\_Parentheses](https://boards.straightdope.com/u/Superfluous_Parentheses)
#### Post date: [June 16, 2011, 7:59pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/5 "2011-06-16T19:59:53Z")

</div>

> [@friedo](#):
>
> While there doesn’t _have_ to be a central repository, nothing stops you from saying “this over here is the official central repository” and making sure everybody checks their stuff into it.
> 
> Git’s diffing and merging is very good, and it can deal with multiple changes to the same file easily. If there are conflicts (two people editing the same part of the same file) then those will have to be resolved manually, but that’s true of any revision control system.

Pretty much this. Also, because branching and merging is very quick and good in git, you can often maintain “parallel branches” to keep work from diverging too far. Example: you have a master branch that’s on the official repository, which tracks the “official latest working version”. If you’re also working on a new feature that can’t be pushed directly onto the master branch (for instance, because the current state of that feature breaks important things, or because you’re not sure the feature is going to work at all) you can do periodic merges or rebases from the master branch into your feature branch, which makes it easier to eventually merge the feature into whatever is the then current HEAD of the master.

And because git is completely distributed, you can keep the feature branch to yourself, or share it with only the people who need to work on it, until you’ve merged it into the master or published your feature as a separate branch on the official repository.

And you keep all the advantages of having a real version control system at any point. You can even rearrange commits etc in your own repository and only publish ‘cleaned up’ versions if you want to, so the official repo isn’t overwhelmed with “oops, quick fix for the last commit” commits.

---

<div class="post-metadata">

### Author: ![Pjen](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@Pjen](https://boards.straightdope.com/u/Pjen)
#### Post date: [June 16, 2011, 8:05pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/6 "2011-06-16T20:05:17Z")

</div>

Off topic but lol.

Git is an insult in British English- now somewhat detoxified but still pretty bad.

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [June 16, 2011, 8:10pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/7 "2011-06-16T20:10:35Z")

</div>

> [@Linus Torvalds](#):
>
> I’m an egotistical bastard, and I name all my projects after myself. First Linux, now git.

yep.

---

<div class="post-metadata">

### Author: ![Pjen](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@Pjen](https://boards.straightdope.com/u/Pjen)
#### Post date: [June 16, 2011, 8:19pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/8 "2011-06-16T20:19:00Z")

</div>

> [@friedo](#):
>
> yep.

lol

Prize for the first person who gives a derivation for ‘git’

Edited to add:

Forget that- its on WP now, didn’t used to be.

---

<div class="post-metadata">

### Author: ![chorpler](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chorpler/32/2888_2.png) [@chorpler](https://boards.straightdope.com/u/chorpler)
#### Post date: [June 18, 2011, 11:00am UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/9 "2011-06-18T11:00:45Z")

</div>

So is it better than bazaar?

---

<div class="post-metadata">

### Author: ![Superfluous\_Parentheses](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Superfluous\_Parentheses](https://boards.straightdope.com/u/Superfluous_Parentheses)
#### Post date: [June 19, 2011, 5:42pm UTC](https://boards.straightdope.com/t/can-someone-explain-git-to-an-svn-user/585687/10 "2011-06-19T17:42:54Z")

</div>

> [@chorpler](#):
>
> So is it better than bazaar?

I think (though I haven’t used bzr extensively) it’s comparable and they were both developed at roughly the same time. Git seems to be a little faster on complex operations.
