git-svn setup tracking:

  • trunk as master
  • branches/$username/* for personal branches
  • tags

Clone

git svn clone --username "$username" \
    -T trunk -t tags -b "branches/$username" \
    https://svn.example.com/repo

Config

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
[svn-remote "svn"]
        url = https://svn.example.com/repo
        fetch = $project/trunk:refs/remotes/trunk
        branches = $project/branches/$username/*:refs/remotes/*
        tags = $project/tags/*:refs/remotes/tags/*

Relocate

  1. Using svn checkout HEAD from the https:// repository. Cache your authentication credentials so git-svn can use them if necessary. This is important.
  2. If there haven't been any commits since your last git-svn rebase make one now e.g. touch kick; svn add kick; svn commit -m "Kicking git-svn". This is important.
  3. Now, in your git-svn checkout edit .git/config. In the svn section, comment out the old url entry (hash or semicolon are valid) and add a new one.
  4. git-svn fetch to fetch a new revision from the new repository
  5. In .git/config comment out the new url entry and restore the old one.
  6. git-svn rebase -l to perform a local rebase
  7. In .git/config comment out the old url entry and restore the new one.
  8. Enjoy the fresh minty taste.