Satya's blog - Ruby on Rails and Subversion

May 24 2007 20:55 Ruby on Rails and Subversion

Instructions on how to quickly get a rails project into subversion, based on http://wiki.rubyonrails.org/rails/pages/HowtoUseRailsWithSubversion. (Actually, almost verbatim but tailored for my work habits. Your mileage may vary.) These are geared towards use at work and with butterfat, especially the first bit about the server.

On the SVN server:
cd to the svn repo, public or private.
su to www-data before creation so that the files will have the proper permissions. This assumes your SVN URL is something like https://svn.yourserver/etc
svnadmin create /path/to/subversion/repo/private/project_name --fs-type=fsfs

In your_rails_app (created by the command `rails your_rails_app`):

# svn import . repository_url -m "Import" --username user
# cd ..
# mv your_rails_app your_rails_app-backup
# svn checkout svn_url_to_your_repository your_rails_app
# cd your_rails_app

Then do these (you should be able to copy paste):

# Remove the log files.
svn remove log/*
svn commit -m "removing all log files from subversion" 
# Ignore the log files when they are re-created
svn propset svn:ignore "*.log" log/
svn update log/
svn commit -m "Ignoring all files in /log/ ending in .log" 
# Ignore the tmp directory with all its content (cache, sessions, sockets)
svn remove tmp/*
svn propset svn:ignore "*" tmp/
svn update tmp/
svn commit -m "Ignoring all files in /tmp/" 

Note: this post is mainly as a note to myself. Your situation may be different. Among other things, I use mongrel, not Capistrano or Switchtower.

Tag: howto geeky