我通过git-svn镜像的svn存储库改变了URL.
在vanilla svn你会做的svn switch --relocate old_url_base new_url_base.
我怎么能用git-svn做到这一点?
只需更改配置文件中的svn url就会失败.
我正在尝试使用这里记录的GCC git镜像.
前段时间,我克隆了git存储库:
git clone git://gcc.gnu.org/git/gcc.git
Run Code Online (Sandbox Code Playgroud)
添加了git-svn的东西:
git svn init -Ttrunk --prefix=origin/ svn+ssh://gcc.gnu.org/svn/gcc
Run Code Online (Sandbox Code Playgroud)
然后git svn rebase和git svn dcommit等所有的工作很好.
几个月后,我在本地git分支上做了各种开发工作,并且我已经对上游SVN进行了更多更改:
从git miror更新:
$ git rebase
Run Code Online (Sandbox Code Playgroud)确保我拥有SVN的最新版本,但它不起作用:
$ git svn rebase -v
Unable to determine upstream SVN information from working tree history
Run Code Online (Sandbox Code Playgroud)不知何故,我打破了元数据!除了上述内容之外,我认为我git svn fetch错误地在某个时刻做过,但这不应该是有害的,不是吗?
所以,我尝试从远程git镜像创建一个新的分支:
$ git branch svntrunk remotes/origin/trunk
$ git checkout svntrunk
$ git svn rebase
Unable to determine upstream SVN information from working tree history
Run Code Online (Sandbox Code Playgroud)
网络搜索表明分支历史在某种程度上与SVN不同,但我已经检查过git log并且每个提交都有相应的git-svn-id …
我在服务器上设置了一个空的svn,我一直在本地进行提交.现在我希望将我的repo提交到svn服务器.为此,我试过:
git-svn checkout http://remote.svn.server.com
git-svn dcommit
Run Code Online (Sandbox Code Playgroud)
Git抱怨说:
Use of uninitialized value in concatenation (.) or string at /usr/bin/git-svn line 411.
Committing to ...
Unable to determine upstream SVN information from HEAD history
Run Code Online (Sandbox Code Playgroud)
由于我首先在我的本地计算机上启动,并且在线回购是空的,我找不到有关如何使这项工作的任何信息.
我正在尝试每天将我的svn存储库同步到git.经过多次阅读,我能够通过在.git/config中手动创建以下内容来完成这项工作:
[svn-remote "svn"]
url = svn+ssh://svn.myserver.com/project/trunk
fetch = apps/ios/project:refs/remotes/mirror/project
Run Code Online (Sandbox Code Playgroud)
然后,我根据此代码创建了一个分支,并将其推送到git repo:
git checkout -b mirror/project mirror/project
git svn rebase
git push
Run Code Online (Sandbox Code Playgroud)
我很高兴,直到我认为我确实通过从磁盘删除克隆的repo并再次克隆它,然后尝试从svn推送一些更新来确保这实际上有效.
git clone git@myrepo.com:myproject
git checkout mirror/project
git svn rebase
Run Code Online (Sandbox Code Playgroud)
这给了我以下错误: Unable to determine upstream SVN information from working tree history
我已经在stackoverflow上阅读了关于此消息的无数帖子,但我还没有理解任何解决方案.是否可以用git新手来解释为什么git选择忘记我的svn配置?