How to switch svn repositories using git-svn?

后端 未结 2 1830
醉话见心
醉话见心 2021-02-07 01:25

I have a number of git projects created as clones of SVN repositories using git-svn. We have migrated our SVN repositories to a new provider so the URL has now changed. How can

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-07 02:07

    I found a page in the git wiki which answers exactly my question:

    https://git.wiki.kernel.org/index.php/GitSvnSwitch

    • Edit the svn-remote url URL in .git/config to point to the new domain name
    • Run git svn fetch - This needs to fetch at least one new revision from svn!
    • Change svn-remote url back to the original url
    • Run git svn rebase -l to do a local rebase (with the changes that came in with the last fetch operation)
    • Change svn-remote url back to the new url
    • Run git svn rebase should now work again!

    This will only work, if the git svn fetch step actually fetches anything! (Took me a while to discover that... I had to put in a dummy revision to our svn repository to make it happen!)

提交回复
热议问题