Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Importing a Rails project to an SVN repository (See related posts)

svn import railsproject svn://whatever/railsproject/trunk


Then check out to a new location with:

svn co svn://whatever/railsproject/trunk railsproject


Then do all the housekeeping from the railsproject folder:

svn remove log/*
svn commit -m "Removed log files"
svn propset svn:ignore "*.log" log/
svn update log/
svn commit -m "Ignoring log files"
svn move config/database.yml config/database.example
svn propset svn:ignore "database.yml" config/
svn update config/
svn commit -m "Moved database file and ignoring future database.yml"


Mostly poached from http://wiki.rubyonrails.com/rails/pages/HowtoUseRailsWithSubversion

Comments on this post

beate posts on Oct 18, 2005 at 10:50
what about the database scheme? Ho do you manage this?
peter posts on Oct 20, 2005 at 13:13
I don't, generally. I may do dumps to db/ occasionally and add them in, but don't use the migrations or schema functions in Rails just yet.
thaislump posts on Oct 25, 2005 at 02:51
I move database.yml to database.yml.tpl and remove any sensitive authentication info /before/ an svn import, especially if it's a public svn repo because even after you `svn mv` the file, it's still accessible in a previous revision(s).
topfunky posts on Dec 30, 2005 at 16:28
Don't do this if you're using Switchtower! I just helped someone debug a Switchtower deployment, and the problem was a missing database.yml.
bansalakhil posts on Feb 06, 2007 at 09:21
or you can use my script

http://webonrails.com/2007/01/10/bash-script-for-creating-new-rails-project-and-initial-svn-import-with-ignoringremoving-logother-files/

You need to create an account or log in to post comments to this site.


Click here to browse all 5137 code snippets

Related Posts