git-svn after an SVN repository is moved?

て烟熏妆下的殇ゞ 提交于 2019-12-07 06:34:57

问题


We recently moved our SVN server from one data center to another, and the IP of the server has changed. I used svn switch --relocate old_url new_url to update my actual working copy, and that was happy.

However, I do most of my work in a local git version of the repository (using git-svn, obviously). After moving the SVN server, I updated the URL for the repo in .git/config, but when I try to use dcommit, I receive this error:

Unable to determine upstream SVN information from HEAD history.
Perhaps the repository is empty. at /home/me/libexec/git-core/git-svn line 520.

What am I missing?


回答1:


In general, this isn't something that git-svn supports directly. The biggest hurdle is that git-svn uses the "git-svn-id" (visible in the commit log for each commit) to uniquely identify commits from SVN -- and the SVN URL is part of this ID. If the URL changes, it pretty much invalidates all of your existing history.

There are workarounds described here which look like they should work, but they aren't exactly simple and I haven't tried any of them myself.




回答2:


It's possible to do this with git-svn by cloning both repos, merging them, then rebuilding the git-svn metadata.

See my answer here.



来源:https://stackoverflow.com/questions/4694623/git-svn-after-an-svn-repository-is-moved

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!