home > developer > gitSvnCheatSheet.html

Monday, September 8th, 2008

Git-SVN Cheat Sheet

Set good “don’t mess with my line endings” option before first checkout:

git config --global core.autocrlf false

Do this one time to suck in the repo w/history from SVN:

git svn clone svn://myrepo.com/project/

Do this loop over and over until your code ready to push back to SVN. The cool thing about this is that the adds and commits can be done off the network! Don’t forget to merge and re-test your changes after the rebase:

git add .
git commit -m "Added some awesome stuff"
git svn rebase

Push all local changes back to the SVN repo, which will now have all the local commits you did when you were on the airplane:

git svn dcommit

One other key tip is what when you want to decommit or rebase but you are in the middle of some changes, don’t worry. git-stash to the rescue:

git stash
git svn rebase
git stash apply

Also, here are a few links that inspired this post:

/developer   〆   permanent link