Subversion

Minimal Subversion tutorial

Create repository:

  1. svnadmin create /home/johanf/repos

Import an existing project:

  1. mkdir existing_project
  2. mkdir existing_project/branches
  3. mkdir existing_project/tags
  4. mkdir existing_project/trunk
  5. # put your files in directory 'trunk'
  6. svn import existing_project file:///home/johanf/repos/myproject -m "initial import"

Note that the name existing_project is irrelevant, files are stored in myproject.


Check out files:

  1. svn checkout file:///home/johanf/repos/myproject/trunk new_name

Here, you must supply the name of the project, myproject, but you can name the resulting dir to whatever you like, e.g. new_name.


In the examples above, repos is the name of your repository.


Now you have a working dir. You could use vim to edit, commit and add new files now.

Mappings in vim:

  1. ,sa Add current file
  2. ,sc Commit current file
  3. ,sg Return to the source buffer

Add a new dir under version control:

  1. svn mkdir -m "Making dir php." http://home/johanf/repos/vc/php

Checking this out (so that the added dir appears in the hierarchy):

  1. svn checkout file:///home/johanf/repos/vc/trunk vc

New setup:

  1. cdw
  2. ~/svn_setup repos $REPOS
  3. cd
  4. cd dv
  5. svn co $REPOS/python/trunk python
  6. cd python

Now add, commit etc


Transmitting file data ..svn: Commit failed (details follow):

svn: Can't move '/media/johanf-pc/media/polo/JohanFrid/newrep/db/transactions/2-1.txn/rev' to '/media/johanf-pc/media/polo/JohanFrid/newrep/db/revs/3': Operation not permitted