Lee McKusick
2006-Oct-12 21:27 UTC
How to set up Subversion version control for a Rails project
Here is how to set up version control for a Rails project using Subversion. I just spent 4 hours and maybe you can do it in 20 minutes with these instructions. I assume your situation is: You are setting up version control on a new subdirectory on your computer. You will copy your entire rails project directory tree into the new subdirectory after you get subversion running. With subversion, you are always working on a COPY of your project subdirectory. Once under subversion, you only edit the copy. You are running Linux, like Ubuntu or Fedora You will store your repository on your local computer. Here is the subversion online book: http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.preface.organization Monkey see, monkey do example of simple svn setup for a single user keeping a repository of a single subdirectory development project called "weedy", showing use of "add *" to suck up stuff as it is created. Get subversion using your package manager, like on Ubuntu: sudo apt-get install subversion; use rpm for Red Hat type distros verify svn --version These examples are for a project subdirectory called "weedy" change for your need. Be sure to create branches, tags and trunk. username-$ mkdir /home/username/repository username~$ svnadmin create /home/username/repository username~$ mkdir weedy/branches username~$ mkdir weedy/tags username~$ mkdir weedy/trunk username~$ svn import /home/username/weedy ----- svn uses "url type names", here this "file:///" is just a local file ----- file:///home/username/repository/weedy -m "initial import" Adding /home/username/weedy/trunk Adding /home/username/weedy/branches Adding /home/username/weedy/tags Committed revision 1. username~$ mkdir work username~$ cd work "svn co" means "svn check out a copy from the repository" username~/work$ svn co file:///home/username/repository/weedy A weedy/trunk A weedy/branches A weedy/tags Checked out revision 1. username~/work$ ls weedy Now do all your editing on THIS COPY, like add all items from existing project by copying. username~/work$ cd weedy/ username~/work/weedy$ touch test.txt You have to tell svn to add any items that you have brought into the work area or created. Next command adds test.txt for version control. username~/work/weedy$ svn add * Next command sends changes you made back to the Repository: username~/work/weedy$ svn update --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Lee McKusick
2006-Oct-13 04:21 UTC
How to set up Subversion version control for a Rails project
Here is how to set up version control for a Rails project using Subversion. I just spent 4 hours and maybe you can do it in 20 minutes with these instructions. I assume your situation is: You are setting up version control on a new subdirectory on your computer. You will copy your entire rails project directory tree into the new subdirectory after you get subversion running. With subversion, you are always working on a COPY of your project subdirectory. Once under subversion, you only edit the copy. You are running Linux, like Ubuntu or Fedora You will store your repository on your local computer. Here is the subversion online book: http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.preface.organization Monkey see, monkey do example of simple svn setup for a single user keeping a repository of a single subdirectory development project called "weedy", showing use of "add *" to suck up stuff as it is created. Get subversion using your package manager, like on Ubuntu: sudo apt-get install subversion; use rpm for Red Hat type distros verify svn --version These examples are for a project subdirectory called "weedy" change for your need. Be sure to create branches, tags and trunk. username-$ mkdir /home/username/repository username~$ svnadmin create /home/username/repository username~$ mkdir weedy/branches username~$ mkdir weedy/tags username~$ mkdir weedy/trunk username~$ svn import /home/username/weedy ----- svn uses "url type names", here this "file:///" is just a local file ----- file:///home/username/repository/weedy -m "initial import" Adding /home/username/weedy/trunk Adding /home/username/weedy/branches Adding /home/username/weedy/tags Committed revision 1. username~$ mkdir work username~$ cd work "svn co" means "svn check out a copy from the repository" username~/work$ svn co file:///home/username/repository/weedy A weedy/trunk A weedy/branches A weedy/tags Checked out revision 1. username~/work$ ls weedy Now do all your editing on THIS COPY, like add all items from existing project by copying. username~/work$ cd weedy/ username~/work/weedy$ touch test.txt You have to tell svn to add any items that you have brought into the work area or created. Next command adds test.txt for version control. username~/work/weedy$ svn add * Next command sends changes you made back to the Repository: username~/work/weedy$ svn update --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Craig White
2006-Oct-13 14:53 UTC
Re: How to set up Subversion version control for a Rails project
On Thu, 2006-10-12 at 14:27 -0700, Lee McKusick wrote:> Here is how to set up version control for a Rails project using > Subversion. I just spent 4 hours and maybe you can do it in 20 minutes > with these instructions. > > I assume your situation is: > You are setting up version control on a new subdirectory on your > computer. > You will copy your entire rails project directory tree into the new > subdirectory after you get subversion running. > With subversion, you are always working on a COPY of your project > subdirectory. Once under subversion, you only edit the copy. > You are running Linux, like Ubuntu or Fedora > You will store your repository on your local computer. > > Here is the subversion online book: > > http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.preface.organization > > > Monkey see, monkey do example of simple svn setup for a single user > keeping a repository of a single subdirectory development project called > "weedy", showing use of "add *" to suck up stuff as it is created. > > Get subversion using your package manager, like on Ubuntu: > sudo apt-get install subversion; use rpm for Red Hat type distros > > verify svn --version > > These examples are for a project subdirectory called "weedy" change for > your need. Be sure to create branches, tags and trunk. > > username-$ mkdir /home/username/repository > username~$ svnadmin create /home/username/repository > username~$ mkdir weedy/branches > username~$ mkdir weedy/tags > username~$ mkdir weedy/trunk > username~$ svn import /home/username/weedy > ----- > svn uses "url type names", here this "file:///" is just a local file > ----- > file:///home/username/repository/weedy -m "initial import" > Adding /home/username/weedy/trunk > Adding /home/username/weedy/branches > Adding /home/username/weedy/tags > > Committed revision 1. > username~$ mkdir work > username~$ cd work > "svn co" means "svn check out a copy from the repository" > username~/work$ svn co file:///home/username/repository/weedy > A weedy/trunk > A weedy/branches > A weedy/tags > Checked out revision 1. > username~/work$ ls > weedy > Now do all your editing on THIS COPY, like add all items from existing > project by copying. > username~/work$ cd weedy/ > username~/work/weedy$ touch test.txt > You have to tell svn to add any items that you have brought into the > work area or created. Next command adds test.txt for version control. > username~/work/weedy$ svn add * > Next command sends changes you made back to the Repository: > username~/work/weedy$ svn update---- I think you meant for this last line to be: svn commit --comments="Your comments for the commit go here" as svn update would not send changes back the repository but svn commit would. Also as a reference... http://blog.teksol.info/articles/2006/03/09/subversion-primer-for-rails-projects Craig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---