Question

We are migrating an old SVN repository to Git. This worked pretty well with svn2git. Now we want to exclusively work on git but need to mirror any new git commits to the old SVN repository. This is necessary because some production systems still are deployed through SVN.

So I tried to use git svn on the same repository where I ran svn2git before. I'm not an expert (yet) but i thought, something like this should do the trick:

$ git svn dcommit --interactive
Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at /usr/lib/git-core/git-svn line 780.

I also tried to get some information about the imported SVN data:

$ git svn info
Unable to determine upstream SVN information from working tree history

So it seems as if svn2git did some magic and left git svn in an "unconfigured state". As far as I know git has to keep some references to map the SVN commits to git commits. The opposite command svn2git --rebase works: it fetches any new SVN commits and applies them to the git repo. So the data seems to be there and usable by svn2git (which AFAIK is based on git svn).

So how can I make git svn work? Or is there another way how we can backport git commits to SVN from that new repo (without starting from scratch)?

Was it helpful?

Solution

Try "git svn rebase".

I faced exactly the same issue and used a wrapper script hosted @vhttps://github.com/nirvdrum/svn2git. Please take come time to read SVN to GIT migration failed using svn2git.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top