Monday, September 19, 2011

git svn non-standard layout

Steps:
1. git svn init TargetDirectory
2. edit .git/config (refer to .git/config [svn-remote "svn"] section)
3. CD TargetDirectory
4. git svn fetch

.git/config [svn-remote "svn"] section
url = https://svn.domain.com:443/svn/sandbox
fetch = trunk/mysite:refs/remotes/trunk
branches = branches/mysite/*:refs/remotes/branches/*
tags = tags/mysite/*:refs/remotes/tags/*

* You can have zero or more fetch lines as long as the Git refs are unambiguous.
* 'branches' and 'tags' lines are each allowed to have a single asterisk (*) on either side of the colon (:) that acts like a wildcard -- the SVN directory name at the position of the asterisk will take the place of the asterisk on the right hand side (which must be the end of the line). Again, you can have zero or more of each of these as long as the left hand side of each is unambiguous.