Local Subversion Repositories

Everyone should be using some kind of version control system for their own files. There are tons of options available, including mercurial, git, CVS and subversion. I've recently had to move some code to subversion so that I can share code with some other groups. You don't need to have a server set up out there somewhere on the interwebs. You can set up your own private repository on your own machine and use that to track changes to your code and documents. The first step is to create space on your drive

mkdir ~/svn

After that, you need to initialize the actual repository

svnadmin create ~/svn

That's it. Now you have a repository that you can use. The very first thing is to import your current code.

svn import /home/jbernard/temprepos/my_sources file:///home/jbernard/svn/my_sources -m "Initial Import"

After this initial import, you can checkout a working copy of the code to work with.

svn checkout file:///home/jbernard/svn/my_sources

All of the other commands assume that you are actually in the subdirectory holding the checked out code. You can check the surrent status of your code with

svn status

Any edited files will be flagged. You can check in these changes with

svn commit

where it will ask you for a comment about the commit. You can grab any changes committed by someone else with

svn update

I'll be adding more commands here as I think of them.

No comments:

Post a Comment