Subversion howto

Subversion access via svn+ssh:// on Windows

If you encounter difficulties with Subversion connectivity on Windows (plink not working, SSH/tunnel errors), check the page Subversion access via SSH on Windows.

Recover a deleted file or directory

  1. Find out the revision in which the file or directory was deleted (say, 123). You'll need the revision just before that (122).

    svn log --verbose | less  # revisions will be listed from newest to oldest
  2. Find out the repository URL

    svn info
  3. Copy the file at that revision from the repository into the local directory:

    svn copy svn+ssh:// ./

Merging a branch into trunk

  1. Check out a copy of trunk:

    svn co svn+ssh://server/path/to/trunk
  2. Find out at what revision the myBranch branch was made

    svn log --stop-on-copy svn+ssh://server/path/to/branch

    This should display back to you the changes that have been made back to the point the branch was created. Remember that number (should be rXXXX, where XXXX is the revision number).

  3. Perform an SVN update:

    svn up

    This will update your copy of trunk to the most recent version, and tell you the revision you are at. Make note of that number as well (should say "At revision YYYY" where YYYY is the second number you need to remember).

  4. Now we can perform the SVN merge:

    svn merge -rXXXX:YYYY svn+ssh://server/path/to/branch/myBranch

    This will put all updates into your current working directory for trunk.

  5. Resolve any conflicts that arose during the merge

  6. Check in the results:

    svn ci -m "MERGE myProject myBranch [XXXX]:[YYYY] into trunk"

Simplified from

Checking out only the latest version

By default, svn checkout checks out everything:

svn checkout --revision HEAD netpbm

Undoing all local changes

svn revert ./ -R

Revert (roll back) to a previous version

Not intuitive at all. See How to revert (roll back) to a previous revision with Subversion.

Creating a repository

svnadmin create path/to/repo

Loading a dump file

svnadmin load path/to/repo < dumpfile
My tags:
Popular tags: