Create a subversion repository for rails

First you need a directory to house your repository. Since I work on multiple projects at home and in the office I need a master directory first. And just to make it simple I use /repos. This could be a link or a real directory.
(To clean-out a old svn directory use the following find . -name .svn -exec ‘rm -rf {}\;‘)
Step 1:
# create /repos
Step 2 (Create a repository):
# svnadmin create /repos/rails_project
Step 3 (Create rails specific directories):
# export REPOS=file:///repos/rails_project
# svn mkdir –message=”Initial project layout” $REPOS/trunk $REPOS/tags $REPOS/branches
Step 4 (Initial Import of project):
# cd /rails_project
# svn import . file:///repos/rails_project/trunk -m “Initial Import…” */ This command import everything from the current directory to the svn server running locally using the file:/// structure */
Step 5 (check-out):
# svn co file:///repos/rails_project/trunk rails_project
# svn co svn://subversion_server/rails_project/trunk rails_project
Both of the above command will checkout the trunk of rails_project into a directory called rails_project.
Step 6 (Rails clean-up):
Go into the newly checked-out rails project
*/ Remove and Ignore the log files */  
# svn remove log/* 
# svn commit -m ‘removing all log files from subversion’ 
# svn propset svn:ignore “*.log” log/ 
# svn update log/ 
# svn commit -m ‘Ignoring all files in /log/ ending in .log */ Remove and Ignore tmp directory */   
# svn remove tmp/* 
# svn commit -m ‘removing all tmp artifacts from subversion’ 
# svn propset svn:ignore “*” tmp/ 
# svn update tmp/ 
# svn commit -m “ignore tmp/ content from now on” */ Move the database config file to an example file and ignore */   
# svn move config/database.yml config/database.example 
# svn commit -m “Moving database.yml to database.example to provide a template for anyone who checks out the code” 
# svn propset svn:ignore “database.yml” config/ 
# svn update config/ 
# svn commit -m “Ignoring database.yml”
 
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: