Subversion Tips

Tree conflicts in SVN

svn resolve --accept working -R .

Where . is the directory in conflict


To compare working copy with all of its local changes to the latest version of that tree in the repository

svn diff -r HEAD

Create a Branch

svn copy svn+ssh:// \
           svn+ssh:// \
      -m "Creating a branch of project"

Limit Log Output

How to limit svn log output to a given number of entries. Use limit option:

svn log -l 5

Moving a Repo from SVN to GIT

Step 1

Use git-svn to clone the repository:

git svn clone --stdlayout svn+ssh:/svn/srv/svn/zephoinc/<your repo>

This will take a while.

Step 2

Run this script to create git tags from svn tags

cd <your repo>

git for-each-ref --format="%(refname:short) %(objectname)" refs/remotes/tags |  cut -d / -f 2- |
while read ref
  echo git tag -a $ref -m 'import tag from svn'

Remove the echo to make it actually do work. Run

git tag 

to verify that the tags were actually created.

Step 3

Add a remote repo and push everything.

git remote add origin<your repo>.git
git push
git push --tags

Related Articles

Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.