Question

I was using git-svn for working with a svn repository hosted on sourceforge. Recently, I updated the sourceforge project which resulted in changes to the svn repository. To be precise, the new svn repository can now be accessed using svn+ssh and the old repository has been made read-only.

Now, in my local git-svn clone directory, I updated .git/config to update the previous url with the new one. However, when I do git svn info or git svn rebase, I get the following error: Unable to determine upstream SVN information from working tree history

Further, I created a fresh git-svn clone using the following command: git svn init -T trunk -t tags -b branches svn+ssh://USER@svn.code.sf.net/p/dmtcp/code dmtcp-git

This clone works fine and there is no problem with it. However, the refs are different than the old clone.

To make things complicated, I maintain a git repository on github where I push changes once they have been committed to sourceforge svn (for historic reasons). This all used to work with the previous sourceforge svn url. But now with the updated repository, the refs got all messed up i.e. they don't match with the repository on github.

Of course, I can do a "git push -f" to update the refs, but wanted to know if someone has any thoughts/ideas on fixing the refs.

Thanks!

Was it helpful?

Solution

git svn uses the root URL for the svn repository for more than just accessing that repository. It also needs that to determine the svn branch, and (at least by default) URLs will be included in commit messages. That latter reason is why your fresh clone shows all the commits as different.

But, you can configure it to continue using the old URL for those other purposes while using the new URL to actually access the repository. You just need to add a rewriteRoot item to the svn-remote section of your .git/config file and set that to the old URL for the svn repository. That should allow you to continue pulling updates from svn.

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