From my experience, git svn is troublesome but sometimes you have no choice.

Using only svn or only git is fine. I used to love svn and switched over to git primarily due to it’s user-friendly structure and interfaces. Unfortunately using git and svn together with a git repository pushing to a subversion trunk branch or some similar setup can get tricky.

I’m not an expert with git svn but I do have some experience with it mainly due to hosting plugins on the WordPress plugins directory and repository.

Such as…

What can go wrong?

Several odd little bugs could popup up while using git svn:

  1. Git branches diverge. In reality they haven’t but after doing a git svn dcommit, you may be stuck with a diverged git master branch.
  2. Svn “Item is out of date” error while trying to do a git svn dcommit.
  3. Git svn reset or git svn rebase taking forever! As if it’s stuck or timed out?

How to fix these issues!

  1. I suspect this is a git svn bug after doing a git svn dcommit. The local and remote branches are not really diverged. I usually just do a git push --force to solve it. Just be sure that your local and remote are the same.
  2. Simply run a git svn rebase to solve this problem. Or altneratively, if you want to pull into your git branch from the latest svn commit, do a git svn reset --hard
  3. It just takes long! Run git svn rebase or git svn reset and go make yourself a coffee. It runs through all the files to match them up and see what differences there are. So if you are patient, it will finish depending on the size of your repository.
Shares