Use git on existing SVN repo
Use git-svn, it is really simple.
First clone your repository with git svn clone
then you can git svn dcommit
your work or git svn rebase
it on the latest changes. Make sure your history is always linear by always rebasing your local branches on master so that you can merge them with git merge --ff-only
.
The best way would be migrating to git
and throwing away SVN.
However, if that's not an option use git-svn
.
When commiting to git/svn separately you'll most likely end up commiting to SVN only very rarely which would result in other developers ending up with huge commits.
You may try SubGit project. Install SubGit into your SVN repository; a pure Git interface (real Git, not git-svn) for the SVN repository will be created. After that you may use both of the interfaces: SVN or Git for your repository.
If you have no access to your SVN server, there's another option to recommend: SmartGit client. It behaves similar to git-svn but proposes more features (tags, ignores, EOL-handling, cherry-picks).
I'd very strongly advocate for git-svn
. Myself and some of my colleagues have attempted to use a Git repro over the top of a Subversion one, and it's a process made of pain and horror.
Admittedly this is for Subversion 1.6.x; I suspect it'd be better with 1.7.x, since that only has a single .svn
directory.
Updating from the repository requires pulling the updates from Subversion, then committing them with Git. That's slow and tedious (admittedly it's fairly slow with
git-svn
, but at least that automates the process).Plus, either you end up downloading every commit with Subversion and committing it manually to Git, or you end up committing bunches of Subversion commits to the Git repository, and
$deity
help you if you ever want to work on a Subversion revision between your Git commits.Git can't handle empty directories, Subversion requires them for the format of its
.svn
directories. Which means you need to keep your.svn
repositories outside the Git repository, so anygit checkout
operation will also need a separatesvn up
.As you note, you'll need to commit everything seperately.
So, using Subversion and Git separately, you'll need to do pretty much every operation in both Git and Subversion. Which means everything takes longer, and you get all the disadvantages of both systems, while they both do a good job of screwing over each other's advantages.