Topic: SVN or GIT for rails development?

I like very much git but at the end i see that svn is more used and tutorials and books about rails and version control systems talks about rails and svn (also in the official rails wiki). Ok it is true that with git i can do everithing offline but i cand like so also with svn if i use a local repository on the very same filesystem.(if for example i'm the only developer who use svn)

Re: SVN or GIT for rails development?

I don't know of a place you can't use git where you can use svn. There is a nice peepcode episode about git as well, http://peepcode.com/products/git.Might want to check that out. Personally I started out use svn for my rails code, but I am now using git. Use what you feel the most comfortable with in my opinion.

Re: SVN or GIT for rails development?

I've started using Mercurial (similar to git, works on windows).
The netbeans integration is great (The netbeans project itself has moved from svn to mercurial).

It makes commits so fast that you do a lot more of them smile

Re: SVN or GIT for rails development?

SVN is probably more supported among Rails devs (Capistrano and script/generate, for instance, have native support for SVN). But I use git for all of my Rails development; there's certainly no problem with git.

I'd done very little work with SVN, so git is the first VC system I've used seriously. Use whatever you prefer, Rails doesn't really factor into that unless it's something really exotic or you need good support in Capistrano.

Re: SVN or GIT for rails development?

Another vote for Git.

Git FTW.

Re: SVN or GIT for rails development?

Branching and portability are great when it comes to Git. Also, you have a single .git file, not a .svn in every single folder (I always hated that).

I'm only a newbie to Git after almost a year's experience with SVN, but there are 3 things that I really love about Git:
* stash
* branching
* submodules (way more logical than externals)

Also, Capistrano 2.2 has improved Git support, so reasons to use SVN are starting to look shaky at this point.

Last edited by gerhard (2008-04-01 06:38:16)

Re: SVN or GIT for rails development?

The rails source is officially moving to Git:
http://weblog.rubyonrails.org/2008/4/2/ … svn-to-git

I am doing so aswell, the setup of a project just makes more sense... why does SVN put a .svn directory within every directory? Git only puts one in the root.

I highly recommend the peepcode Git screencast, well worth

ThinkRefresh - Free Rails Techniques Screencasts

Re: SVN or GIT for rails development?

I'm with Rare; whilst I only dabbled in SVN, Git just seems a whole lot nicer - particularly with regards to the single .git folder. I bought the Peepcode Git tutorial, and despite a couple of configuration issues, all of which are now documented in the Google Group, it was a great introduction to Git.

Re: SVN or GIT for rails development?

Actually what I find best about git is the ease in  ignoring files using a single config file. Especially since this can be done before your first commit.

Re: SVN or GIT for rails development?

Is there a GIT plugin for Eclipse/RadRails?

I still don't get what the fuss is about, but it looks like the Rails community is jumping to the shiney new thing and we have to follow ....

Toby Hede
===================================================
FiniteStateMachine - Software Development for Social Networks
===================================================

Re: SVN or GIT for rails development?

The reason I like GIT over SVN is the ease of setup.

In SVN to setup a Rails project, you have to import it, check it out, run loads of removals and ignores just to get going.

In Git this is my process:

git init
mate .gitignore
git add .
git commit -m "Initial Import"

In the .gitignore file you put any files or directories you want to be ignored, so my file is typically:

*.DS_Store
log/*
db/*.sqlite3
db/schema.rb
spec
stories
tmp/*
test

Git is also much faster than SVN (on my machine anyway), so Capistrano deployment is blazing fast.

ThinkRefresh - Free Rails Techniques Screencasts

Re: SVN or GIT for rails development?

I don't see what the big deal is. I had never really used any source control before my friends gave me a job and I learnt subversion because that's what they are using and it's their company, so I also started using it on a personal project as well. I'm not missing anything by not switching to GIT as subversion handles our needs adequetly. I'm sure that if we were between projects or just starting a repository then we would look at GIT, but mid project it seems overkill to just jump on a band wagon because people are talking about it. I'm sure GIT is great, but it doesn't make subversion crap, so use whatever you like, and don't feel like you have to switch because others are.

Re: SVN or GIT for rails development?

I'm sticking with SVN for my serious projects for now. I have been playing around with git just to understand it. I do like the quick setup, lack of need for a server, and how easy it is to make branches. I'm still trying to wrap my mind around push/pull and merging code from separate git repos.

One of the reasons I'll stick with SVN right now is integration with NetBeans and the handy TortoiseSVN tool. I like the GUI crutches.

My biggest concern as a Rails developer is dealing with plugins from both SVN and git sources, but apparently the Piston guys are working on that.

Re: SVN or GIT for rails development?

Blast from the past!

My main experience with team dev is using svn as our central repository. I didn't set it up so I'm not 100% familiar with it, but it has performed admirably.

Fast forward to today, when I'm looking at git due to the entire rails world switching over. But I have a fundamental newb question I can't wrap my head around.

Assume this scenario: 5 devs, one project. Using svn, you would get latest, commit changes, view differences, etc etc all against the central repository, and then eventually use that repository to deploy from. From what I've been seeing with git, everyone has their own repository, which confuses the hell out of me. How does this work in practice? What if someone is working remotely? How do you get all latest changes? How does deployment work?

yes, I know there are a ton of git links out there, but in all the quick start guides and so on I can't seem to find a simple answer to this fundamental question.

Illumination appreciated.

Re: SVN or GIT for rails development?

There are no latest changes, except if you define someone as the master who will be pulling everybody's changes. You actually make zillions of merges of everybody's repo, git synchronizes repos between themselves on pull/push, it's really impressive to see in action.

Re: SVN or GIT for rails development?

We used svn too, but after a while, when many features were developed at the same time, it was overkill to use svn. So we moved to git. We still use central repository style (everything goes to server). If there's like 2-3 developers in the team, then you'll probably don't need git.

Git is best in my opinion.
Branching and merging is made so easy that I'll never go back to svn. I can switch branch and I'll have whole different code etc in a second.

Re: SVN or GIT for rails development?

Well I have been using git now for ages as well, and it is better, it might not be for everyone (I'm looking at you Windows users), and I guess Subversion is probably the best they can choose easily.

Git is great people, if you are just starting source control or starting a new project just jump in and learn it, you won't regret it.

Re: SVN or GIT for rails development?

I've used both, i wouldn't say that either is intrinsically better but i've never worked with a repository where more than 3 people were regularly using it.  I would never change halfway through a project but if i was starting a new one now you should use git because

a) you already used svn an it's good to know both.
b) git is the trend, ie the future is git-shaped.  Might as well roll with the changes.

###########################################
#If i've helped you then please recommend me at Working With Rails:
#http://www.workingwithrails.com/person/ … i-williams

Re: SVN or GIT for rails development?

As I see it there are a couple of huge benefits to using GIT.

1. Easy branching has already been talked about, but it's huge. If you're working on a new feature and need to switch over without tainting your master branch, you can do so and commit as you go. Then push to another repository when you need to back it up. This also makes it easy to share without relying on one central repository. Merging is a snap and works more or less like SVN.

2. Most plugins and gems have moved from subversion to git (http://github.com specifically), which means that if you wish to contribute to the community, you're going to need git. If you don't know about git and github.com, you're missing quite a bit of the community that is extremely convenient.

3. Tools like gitjour allow you to share and clone data without access to the internet.

Re: SVN or GIT for rails development?

woody2shoes wrote:

As I see it there are a couple of huge benefits to using GIT.

1. Easy branching has already been talked about, but it's huge. If you're working on a new feature and need to switch over without tainting your master branch, you can do so and commit as you go. Then push to another repository when you need to back it up. This also makes it easy to share without relying on one central repository. Merging is a snap and works more or less like SVN.

2. Most plugins and gems have moved from subversion to git (http://github.com specifically), which means that if you wish to contribute to the community, you're going to need git. If you don't know about git and github.com, you're missing quite a bit of the community that is extremely convenient.

3. Tools like gitjour allow you to share and clone data without access to the internet.

gitjour is ok, but check out a newer idea in the same vein, bananajour, http://github.com/toolmantim/bananajour/tree/master