views:

777

answers:

10

Which version control system should I use for a Rails app: Git or SVN?

Here are some factors to consider:

  • I'm the sole developer
  • I'm familiar with SVN
  • I've only used Git for a week, it seems pretty similar to SVN really.
  • I want to put my repository on a remote location and connect to it via SSH or other protocol (which I already do with SVN).


Edit: Thanks for the responses so far. It seems like Git is slightly more favoured. Does it have any SSH functionality?

+11  A: 

I'd say go for Git. Mostly because I'm biased, but also because you don't need to setup any sort of server with Git, you just git init and go. Git is generally just better, it provides more flexibility and power than SVN does.

Edit: This is a bit of a dupe of Why is Git better than Subversion, or at least relevant.

Edit2: Git has 3 primary methods of communication, the Git protocol, SSH and HTTP. Github uses SSH for "push access", e.g., [email protected]/user/repo.git.

sebnow
You don't need to setup a server for using svn either if you are the only developer, and you can use svn over ssh as well. And you can always get the best of both systems by using git svn :)
bluebrother
Unless there's something I'm not aware of, you have to setup the server in order to start a repository with Subversion. You have to create a "database" with `svnadmin create`, afaik. I'd say using git-svn would limit you're ability to use git properly. If you use SVN, just use SVN, and vice versa.
sebnow
+4  A: 

As a single developer who is already familar with SVN - if you want to be as productive as possible use SVN.

If on the other hand you really want to learn GIT and can afford a bit more time to learn it, use GIT.

morechilli
I'd argue that one can be far more productive with git. I'd be careful not to confuse productivity on day 1 vs. productivity on day n.
Dustin
If by productive, you mean "waiting for svn's slow network transfersrequired by every operation", then yeah... svn is productive.
jrockway
How often do you seriously wait on svn? If svn's transfer speeds are really doing considerable damage to your productivity you should learn to multitask.
vanja.
+1  A: 

Since you're solo and want to put it on a remote location: SVN, but you should learn/use Git as well. You could also combine the two, use Git locally and SVN for the remote..

Tuxified
Why bother? Git can also have remote/central repositories. Why use Git if you end up limiting yourself to Subversion in the end anyway?
sebnow
Well, in my case, we use a windows Subversion server and there's no stable git deamon/server for windows. I agree that Git's a better choice but it's not as mainstream as Subversion is... it all depends one his situation ;)
Tuxified
That's true. Being a Mac/Linux user I forget that Git isn't as compatible with Windows. All the more reason to switch OSs, am I right? :P
sebnow
+1  A: 

It's probably a good idea to use some sort of version control. It's also probably a good idea to have remote backups of your code.

Git and svn are both good version control solutions and are both popular within the Ruby/Rails community.

If you were in a distributed development group I'd suggest git might be more appropriate since one of its specific design goals was for that situation.

If you were on Windows, I'd hint that TortoiseSVN probably provides a less challenging experience than, say, msysGit.

Mostly, though they both seem to do a similar job and do it well.

If you specifically want to learn a new source control system while building your project, go for git. Or if you intend spending a lot of time in, for example, edge Rails, which lives at Github, again might as well go for git.

Otherwise I'd say you should stick to svn.

Mike Woodhouse
+4  A: 

Use Git, if for no other reason than that you can use it almost exactly like SVN (including remote management of multiple branches over SSH) and it's much, much faster and more reliable. Local checkins and branches, distributed version control, revision history management, etc. are only side benefits.

In my experience the only reasons to prefer SVN over Git are: a legacy SVN repository, or the requirement to use Windows on the client.

Joel Hoffman
A: 

I'd say there's no particular difference.

Both systems are just tools, and both of them will provide you with with the functionality you're looking for. If there's no other parameters to consider, I'd say go with SVN as you already know it and you don't need time to learn it.

Alex
+1  A: 

If you have a day to learn Git, then learn Git. It has all the functionality that svn has, plus cheap branching/merging, local commits, and the option of distributed development.

It is easy to work with remote repositories. If you're just looking for some kind of public hosting, then you might want to look at Github, which has free public hosting, good Ruby integration, and many pretty graphs.

Steve Johnson
A: 

I'd add one follow-up question: are you working on this alone? The GUI tool support for Git is generally lagging that of Subversion, so if that is or might become a consideration, then I would opt for Subversion.

For example, if your designers use Adobe CS4, they can use its built-in Subversion support (and you don't have to teach them Git). So consider the current and future composition of your team as a factor in your decision-making.

runako
A: 

I used to love git, but have recently switched to mercurial. It has exactly the same syntax as git, but is written in python, and has lots of nice bells and whistles out of the box, like a web server for visual tracking of commits.

I know that this can be set up for git using gitweb for example, but it requires a bit of work.

DasBoot
+2  A: 

I would have replied in comments but I can't, yet.

For those who don't know, Git work with Windows. If you don't like the msys's version, TortoiseGit is already usable.

brunoqc