I have a project that requires to port a Git repository to SVN. I tried several ways posted online, but none of them works for me. If someone can help, it'd be really appreciated.
I followed a guide on
git svn rebase
and git svn dcommit
The problem of this method is that my Git repository has a complicated history. There are many branching outs and merges. When I did cherry pick, it only picks back part of the final repository.
Question: Is there any way to avoid cherry picking and git svn rebase
?
Maybe replace it with something else?
I followed this web post: Migrate a Git repo to an svn one
This post essentially
git svn clone
git svn rebase
)git dcommit
The problem of this approach is similar to what I had in the first one:
When I did git svn rebase
, there are a lot of conflicts.
Also, when I skip all the conflicts, the git dcommit
failed.
It told me: Unable to determine upstream svn information from HEAD history.
I can't tell what else to try from this point on. Please give any suggestions if you notice anything I did wrong or have other ways to do it. Appreciated it!!
I suppose you have no choice but to lose some of your git history - SVN just can't handle that much information.
The only hack I'm thinking of, for delegating problems to a third party, would be to take advantage of GitHub's SVN support to ease your task.
I'd recommend you to really think if you need to keep your history at all, or how complete it needs to be. Based on that, I'd just squash/rebase the conflicting commits (or the whole history in a single commit) and start off from that.
May the fork be with you!
Well, you must take a look at this question. Best answer is:
The general problem with doing conversions this direction is that Git repositories can contain more than just a linear history of revisions, as Subversion would expect. Multiple ancestries with divergent histories and frequent merge commits are all possible, which can't be easily represented in a Subversion repository.
For simple cases where you do have a linear history in your Git repository, you can use git-svn dcommit to push the lot up to an otherwise empty Subversion repository.
Best regards.
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