How to connect a live site to Subversion
Posted by Andrew Wed, 08 Feb 2006 22:37:00 GMT
Subversion source control management is a big improvement over CVS. But newcomers often ask, “yes, but how do I set up a live website with SVN?”
Here is the step by step procedure.
REPOSITORY LAYOUT
Create the layout you prefer, e.g. /trunk /branches /tags .
For discussion of repository layouts, see the Subversion Book
remotely on your client$ svn mkdir -m "adding web root" https://svn1.avlux.net/YOUR_REPOS/homesite $ svn mkdir -m "adding trunk dir" https://svn1.avlux.net/YOUR_REPOS/homesite/trunk $ svn mkdir -m "adding branches dir" https://svn1.avlux.net/YOUR_REPOS/homesite/branches $ svn mkdir -m "adding tags dir" https://svn1.avlux.net/YOUR_REPOS/homesite/tags
or locally on the server
SSH into your domain (you will be prompted to authenticate on each operation):
$ svn mkdir -m "adding web root" https://svn1.avlux.net/YOUR_REPOS/homesite Authentication realm: <https://svn1.avlux.net:80> avlux.net Subversion Repository Password for 'avluxnet': <Enter your SSH password> Authentication realm: <https://svn1.avlux.net:80> avlux.net Subversion Repository Username: <Enter your SVN username> Password for 'SVN_user': <Enter your SVN password>
INITIAL IMPORT
remotely on your client
cd to the root dir of your website on your own boxsvn import . https://svn1.avlux.net/YOUR_REPOS/homesite/trunk -m 'initial import'
or locally on the server
SSH into you domain
cd to ./rails/ for a Ruby on Rails site,
or to ./httpdocs/ for a non-RoR sitesvn import . https://svn1.avlux.net/YOUR_REPOS/homesite/trunk -m 'initial import'
FIRST CHECKOUT
SSH into your domain
cd to ./rails/ for a Ruby on Rails site,
or to ./httpdocs/ for a non-RoR site$ svn checkout https://svn1.avlux.net/YOUR_REPOS/homesite/trunk ./
SUBSEQUENT UPDATES FROM REPOSITORY TO LIVE SITE (WORKING COPY)
SSH into your domain
cd to ./rails/ for a Ruby on Rails site,
or to ./httpdocs/ for a non-RoR site$ svn update








This post is helpful for setting up a rails app with all the appropriate svn:ignores, which can be a little frustrating without good guidance. :-)