In our distributed development teams, we have a centralized SVN repository placed remotely which is used for multiple teams committing there source code. In order to improve local performance, we have decided to use Gerrit (certainly Git instead of SVN) for our code review process, therefore we're setting a Git's master as a "HUB" interoperating with remote SVN repository.
Typically, the workaround to this problem is git-svn. However, the branch cloned via git-svn has a different folder structure rather than traditional ".git", which can NOT be recognized by Gerrit.
So we adopt a means looking a bit naive..
At exactly the same directory as SVN working copy, git clone the counterpart git repository. So in this directory there's also a ".git" besides ".svn".
$ svn co http://remote.svn.repository/some_project
$ cd some_project
$ git clone --no-checkout git_reop ./tmp
$ mv ./tmp/.git ./ # Move .git directory to SVN working copy.
$ rm -rf ./tmp
$ git reset --hard HEAD # This is tricky to tell git I want to use this directory as unstaged.
Are there any problems if using a shared repository between SVN and Git, only by pull the Git repository into the same directory as SVN working copy without git-svn?
No real "problem" in that both system can pretty much ignore one another.
(Except git needs to ignore any .svn/
directory, or the unique .svn/
folder, if you are using the latest SVN 1.8)
But your git repo must have gotten all the latest changes of http://remote.svn.repository/some_project
before being cloned within that repo (in order to be used by gerrit).
And you can't retain author and dates with git-svn, I don't think a manual sync could either, which means your code review system (gerrit) might not be as efficient in those condition (i.e. reviewing changes without knowing the author).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With