Monday, January 29, 2007

I looked at the irc channel #CVS today. Not many people there and those that were there had attitude. Basically saying CVS is dead and go use SVN! So I looked at the #SVN IRC channel and it's really bustling. Over 200 people on it. Then I went to look for documentation and there was an online version of the book supported by the people who code SVN. Well the documentation looked sweet but it didn't have the basics, like how to start. Instead it said things like, see x or chap 5. Look at X and it says see the last part of chap 1. Look at chap 1 and nothing is there. Look at chapter 5 and it doesn't cover the subject. So I go back to #SVN and ask how do I check in files and somebody gave me bad information and then gave up and pointed me towards his help file which I'll use if I ever come back to SVN.

#### Creating a svn repository ####

// Create the svn repository where all the files and different versions will be keept
svnadmin create /www/svn/myproject

// Add directories for your main trunk and tags, and branches
svn mkdir file:///www/svn/myproject/trunk -m "adding the trunk directory"
svn mkdir file:///www/svn/myproject/branches -m "adding the branches directory"
svn mkdir file:///www/svn/myproject/tags -m "adding the tags directory"

// double check your repository
// list what is in your repository
svn list file:///www/svn/myproject/

// look at your repository info
svn info file:///www/svn/myproject/

// Import an existing project into your repository
cd /www/myproject/
cd ..
svn import myproject/ file:///www/svn/myproject/trunk -m "Importing my project"

// double check your prepository
svn list file:///www/svn/myproject/trunk

// check out your repository to the working directory
cd /www/myproject
rm -rf *
svn co file:///www/svn/myproject/trunk .

### Working with your checked out copy ####

// add a file and commit it to the repository
cd /www/myproject
touch my-test-file.txt
svn add my-test-file.txt
svn commit . -m "Added the my-test-file.txt"

// rename a file and commit changes
cd /www/myproject
svn mv my-test-file.txt my-test-file2.txt
svn commit . -m "Renamed my-test-file.txt to my-test-file2.txt"

// delete a file and commit changes
cd /www/myproject
svn rm my-test-file2.txt
svn commit . -m "Deleted my-test-file2.txt"

// List the changes locally and in the repository
svn status -u

// Making tags or branches
svn copy -m "Notes about the project"

No comments: