Trace: » cocoa_basics » c_plus_plus » subversion

Table of Contents

Things to know about Subversion and more

So, first thing Dreamhost has a subversion support. That means you can create a svn.yourdomain.com to keep your repositories. If you set up your dreamhost account as an ssh account you have to do couple of tweakings setting up Subclipse though.

Creating a repository through terminal

Assuming you have a repository base set up at svn.yourdomain.com, first thing you should do is to copy your project into this space. There are number of ways doing it; Thinking you are in the local directory where your project is residing.

scp projectname yourname@domain.com:/home/yourname/svn/ 

will make sure you copy your project to the remote server and then now you can create a repository in the remote server and then import your project in the repository.

create a repository:

 
svnadmin --fs-type fsfs create /home/yourname/svn/projectRep

find where you scp’ed your project on the remote server and then go to that dir, then import your project into the repository:

svn import projectname file:///home/yourname/svn/projectRep

next thing you want to check out the project in order to work on it locally :

svn co svn+ssh://username@domain.com/home/name/svn/projectRep

Note svn+ssh. This means you are accessing the repository through an SSH connection.

This is how you commit, meaning you work on the code locally and want to update it remotely too:


#update
svn up
#commit, this will open a text editor for comments
svn ci
#this specifies the comment up front
svn ci -m "this is a comment"

One thing to note again is, if you add a new file to your project you should add it manually to the repository, here are some svn comands that might be helpful:

The following commands schedule files and directories for inclusion in the repository. They are not added until svn commit is executed. To unschedule type svn revert.

#add a file
svn add file.c
#add a directory recursively
svn add directory
#add everything that has not been added
#--force is necessary to make svn recurse into dirs that are already in
svn add . --force

reference: http://stefanix.net/subversion

Setting up Subclipse in Eclipse

Couple of links that might be useful are below:

Those links are quite helpful with the overall process. One thing you shouldn’t forget whne you are setting up the repository, you have to write the server like this:

svn+ssh://username@domain.name/home/username/svn/repositoryname/

and then you can import your project through your right clicking your project in your package explorer and then selecting team>share. It’s also pretty straightforward to checkout a project which you import it from the repository through FILE>IMPORT from svn repository, and then adding files are in your context menu in the team property too.