Wed 1 Feb 2006
I’ve successfully imported the iodpersonnel code into Subversion.
To do this, I created a new directory called svn. I copied all files and folders that belong in the repository into this folder. This file structure looked somewhat like this:
svn/
- README
- control/
- css/
- includes/
- index.php
- js/
- model/
- view/
Then I imported the project:
svn import . http://domain.com/path/to/repos/projectname \
-m "Importing initial iodpersonnel project"
Subversion automatically creates the directories in this path if it needs to. I called my project ‘iodpersonnel’ (which replaces ‘projectname’ in the code above).
To checkout the project, move to what would be the parent directory of where you’d like to execute the checkout. For this project, I wanted to store it under /oceaninfo-dev/iodpersonnel. From the oceaninfo-dev folder, I typed:
svn checkout http://domain.com/path/to/repos/iodpersonnel
That’s all. Now I have a working copy of the project straight from the repository. No trunks, no branches, no tags… nothing else to worry about.
Some of the straight-forward commands which mimic UNIX terminal commands:
svn add - Add a file to the repository
svn delete - Delete a file from the repository
svn copy - Copy a file within the repository
svn move - Move a file within the repository
The three most commonly commands:
svn commit - Commit changes to the repository
svn update - Update your working copy from the repository. Together with svn commit, this completes the 2-way cycle of pushing and pulling to and fro the repository.
svn status - Check your working copy against the repository
Now that the iodpersonnel project is in Subversion, it’s time to checkout the code to the production area as well to fully complete the circuit of this project’s workflow.
Note there are some files excluded from the repository:
- config.php is not included, though config-sample.php is (see post below)
- .htaccess is not included. This file should be created manually for each working area.
Next projects are the interoperability and cce-lter web sites. These are more advanced projects, with images and docs. As explained in the post below, the docs folder that sits at the web root will be excluded from the repository. Additionally, any distributed folders that contain documents as part of an integrated web app (iForum) are also to be excluded.
2 Responses to “Subversion Pass #1”
Leave a Reply
You must be logged in to post a comment.


February 1st, 2006 at 12:14 pm
I forget to mention that the initial svn folder I created serves no other purpose than to import the code into subversion. Once the project is in the repository, this folder and its contents can be deleted. It is not considered a working copy of the repository. Only folders that have been explicitly checked out from the repository are working copies.
February 2nd, 2006 at 6:02 pm
The production site is now in Subversion. I just updated the production site by issuing a ’svn update’ command, and it worked perfectly! Yay!