2. Who?
●
Git user who needs to work on project that uses SVN
●
SVN users who wants to learn Git
●
Because you can
3. Why?
●
Able to work on multiple branches from same project directory.
●
No need to be on VPN to pull the revision history.
●
Local branches, Stashing, local commits
4. How?
$ git svn clone svn://internal-repo/Project Project -s
(-s == Standard model, trunk, branches, tags)
OR
$ git svn clone svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/
prefix must trail with “/”
OR
$ git svn init svn://internal-repo/Project Project --trunk=trunk --branches=maintenance/* --prefix=git-svn/
$ git svn fetch
8. commit
$ git svn rebase (similar to ‘git pull’/ ‘svn update’, will rewind your changes and applies your changes on top)
$ git svn dcommit
SVN
Each “git commit” will be checked in as separate revision in SVN.
9. Working on branch
$ git checkout -b branch2 refs/remotes/git-svn/branch2
Don’t forget the refs/
You can now commit and dcommit on this branch
●
Merge is not recommended (Tree conflicts, commit to wrong branch). Merge branches in SVN.