gpt4 book ai didi

git - 如何使用 git-svn 切换 svn 存储库?

转载 作者:IT王子 更新时间:2023-10-29 01:16:55 27 4
gpt4 key购买 nike

我使用 git-svn 创建了许多 git 项目作为 SVN 存储库的克隆。我们已将 SVN 存储库迁移到新的提供商,因此 URL 现在已更改。如何更新我的 git clone 的远程 SVN URL?

一种可能是我从新的 SVN 存储库重新克隆,但我不想这样做,因为在提取整个历史记录时,这个过程可能需要几天时间。

提出这个问题的另一种方式是,git 在哪里存储有关您正在使用的远程 SVN 存储库位置的信息? IE。当您键入“git svn info”时,URL 信息来自哪里?

最佳答案

我在 git wiki 中找到了一个页面,它完全回答了我的问题:

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!)

关于git - 如何使用 git-svn 切换 svn 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5975667/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com