Use SVN Repo offline

If you want to use your repository offline so that you can make some changes and commits in your hollidays then you can install svk. With svk you can mirror an existing svn repos to your local harddisk and it allows you to commit changes, to move files, to add new files and to delete files from the repository. After the hollidays you can push the changed data to the online repository to share the changes with other users.

First of all you have to check whether svk is already installed on your system or whether you have to install it.


The next step is to initialize the local depot svk depotmap --init. Thereby a new hidden folder will be created in your home direcotry. With ls ~/.svk/ you should see the folders cache and local and the file config. The repository information are not saved in the checkout folder like in svn.Following that you have to create the mirror directory svk mkdir //mirror. This is the local mirror directory for the remote directory.

After that you can mirror a repository svk mirror https://testserver.com/svn/proj1 //mirror/proj1.These are the most important steps. Now you can start with the work. Before you start working offline you have to sync your local repository so that you have the newest version svk sync //mirror/proj1.

Make your first checkout now. Therefor create a new directory called like your project mkdir proj1, go into this directory. Then checkout the data svk co //mirror/proj1.

Finally you can use the svk like svn with all commands. The only changes are that you can work now offline and you have to work with the svk commands in the chechout directory instead of the svn commands.

  • svk add NewFile
  • svk move OldPath NewPath
  • svk delete OldFile
  • svk commit

Keep local mirror up-to-date:

  • svk pull //mirror/proj1 Get changes from remote repository
  • svk push //mirror/proj1 Send your changes to the remote repository

HowTo handle conflicts:
I will write a little howto in the next few weeks. So the best thing is if you avoid any conflicts….

Tags: , , ,

One Response to “Use SVN Repo offline”

  1. martin Says:

    What about conflicts? What happens when there
    is a conflict and svn refuses to merge/commit the files?

Leave a Reply

You must be logged in to post a comment.