Setting up a local SVN repository

 You can create a Subversion repository on your computer and use file:// scheme to interact with it locally. This approach can help you use Subversion locally to track personal files and single-person projects.

The following procedure creates a minimal environment for an existing project. It converts a directory with a project into a working copy of a newly-created local Subversion repository. As result you can modify the files in the working copy and track the changes in your local repository.

On Unix:

  1. Create a parent directory .svnrepos where you will place your SVN repositories: $ mkdir -p $HOME/.svnrepos/
  2. Create a new repository MyRepo under .svnrepos: $ svnadmin create ~/.svnrepos/MyRepo
  3. Create a recommended project layout in the new repository: $ svn mkdir -m "Create directory structure." \  file://$HOME/.svnrepos/MyRepo/trunk \  file://$HOME/.svnrepos/MyRepo/branches \  file://$HOME/.svnrepos/MyRepo/tags
  4. Change directory to ./MyProject where your unversioned project is located: $ cd $HOME/MyProject
  5. Convert the current directory into a working copy of the trunk/ in the repository: $ svn checkout file://$HOME/.svnrepos/MyRepo/trunk ./
  6. Schedule your project's files to be added to the repository: $ svn add --force ./
  7. Commit the project's files: $ svn commit -m "Initial import."
  8. Update your working copy: $ svn update

Comments

Popular posts from this blog

How Things Used To Be

Controversial programming opinions

Some lesser-known truths about programming