Alister West

home is where your code is ...

Git SVN

A quick reference for me and git-svn

Setup!

git config branch.autosetuprebase always
git-svn show-ignore >> .gitignore

Checkout!

# clone with standard layout:
git svn clone -s https://foo.example.com/svn/myproject  my_project

# you can also do this in 2 steps (init and fetch).
git svn init -s https://foo.example.com/svn/myproject  my_project
cd my_project; git svn fetch

Workflow 1. Basic workflow on trunk

git checkout master
.. hack .. hack .. commit
git svn fetch
git svn rebase
git svn dcommit

Workflow 2. Develop on dev branch.

git checkout dev
.. hack .. hack ..
git commit
git checkout master
git merge dev
git svn fetch
git svn rebase
git svn dcommit

References

  • "gitsvn workflow":http://blog.smartbear.com/the_smartbear_blog/2009/06/gitsvn-workflow.html
  • "effective git with svn":http://www.viget.com/extend/effectively-using-git-with-subversion/
By Alister West