The git manual describes the svn capabilities as follows:
git svn is a simple conduit for changesets between Subversion and git. It provides a bidirectional flow of changes between a Subversion and a git repository.
git svn can track a standard Subversion repository....Once tracking a Subversion repository (with any of the above methods), the git repository can be updated from Subversion by the fetch command and Subversion updated from git by the dcommit command.
You can create a fully featured git repository from the trunk of a subversion repo with the following command:
git svn init -T https://svn.hostname.de/svn/projects/project/trunk
The git repository, that you just created is hooked to the trunk, passed with URL in the command. To get the HEAD, just run:
git svn fetch
Now you are ready to work with git, as if you had cloned a repo from GitHub. You can work with branches locally and commit your changes offline. When you want to share your work and push it back to subversion, you can use the following command:
git svn dcommit
You might ask yourself how to get the latest changes from your fellow developers? First, you should have no un-commited changes when you run:
git svn rebase
The reason for that, is this command is similar to svn update. It uses git-rebase instead of git-merge, in order to preserves linear history.
Those couple of commands got me started in no time and I didn't have to wait for a company-wide repository in order to have all the advantages that come with git.
2 comments:
I'm also doing the same path as you do for a couple of months now. Everything went smoothly until today. I did a dcommit for a bunch of git commits and the internet connection got cut off somewhere in the middle. After that all the code revisions that I did are all gone. Oh well. :(
Thanks for the advice, I guess my next dcommit is not gonna happen using 3G :-)
Post a Comment