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

Software Compatibility Best Practices

I spoke to some of the most talented and experienced software developers. I have created a guide that is filled with valuable insights and actionable ideas to boost developer productivity.

You will gain a better understanding of what's working well for other developers and how they address the software compatibility problems.

Get the Guide Now