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…
- WordPress Newsletter plugin
- WordPress Slideshow Gallery plugin
- WordPress Gallery Voting plugin
- and more…
What can go wrong?
Several odd little bugs could popup up while using git svn:
- 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. - Svn “Item is out of date” error while trying to do a
git svn dcommit
. Git svn reset
orgit svn rebase
taking forever! As if it’s stuck or timed out?
How to fix these issues!
- I suspect this is a
git svn
bug after doing agit svn dcommit
. The local and remote branches are not really diverged. I usually just do agit push --force
to solve it. Just be sure that your local and remote are the same. - 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 agit svn reset --hard
- It just takes long! Run
git svn rebase
orgit 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.
Recent Comments