如何使用 AnkhSVN 在 Visual Studio 中切换 Subversion 存储库?

发布于 2024-08-21 14:24:30 字数 156 浏览 6 评论 0原文

我一直在本地开发一个项目,并使用本地 svn 服务器在 Visual Studio 中进行版本控制。我现在想切换到 xp-dev 托管版本控制,但似乎无法摆脱我的解决方案上的 svn 绑定?有没有一种简单的方法可以在没有版本控制设置的情况下复制解决方案或简单地切换到另一个 svn (完全是空的)?

I've been developing a project locally and using a local svn server for versioning in visual studio. I now want to switch to xp-dev hosted versioning but cannot seem to get rid of the svn bindings on my solution? Is there an easy way to duplicate a solution without its versioning settings or to simply switch to the other svn (which is completely empty)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

生生漫 2024-08-28 14:24:30

有一个内置的切换/重新定位:

  • 打开视图 ->待定更改
  • 单击显示当前存储库 URL 的下拉列表,或该按钮右侧的按钮
  • 输入/浏览到新位置
  • 将出现一个对话框,显示您是否要重新定位(因为此处切换还不够)

There's a switch/relocate built-in:

  • Open View -> Pending Changes
  • Click the dropdown that shows the current repository url, or the button to the right of that
  • Enter / browse to the new location
  • A dialog comes up wether you want to relocate (because switching isn't enough here)
第几種人 2024-08-28 14:24:30

编辑:请注意,这假设您正在尝试移动到新存储库,删除所有历史记录,而不是移动存储库。考虑一下,您可能希望通过简单地将文件夹导出到新存储库的新创建的工作区中来替换删除所有 .svn 文件夹。

据我所知没有。我可能会这样做,

  • 从解决方案中删除所有 .svn 文件夹
  • 在新存储库中为解决方案创建一个文件夹,
  • 检查一下,
  • 将当前解决方案移到该文件夹​​中,
  • 在 Visual Studio 中加载解决方案
  • 使用 AnkhSvn 添加再来一次。它应该知道它位于一个被颠覆的目录中,并允许您这样做。

Edit: Note that this assumes that you are trying to move to a new repository, dropping all your history, not move a repository. Thinking about it you might want to replace the removing all .svn folders with simply exporting the folder into the newly created workspace for the new repo.

Not that I know of. I'd probably do this,

  • Remove all the .svn folders from your solution
  • Create a folder for the solution in the new repo,
  • Check it out,
  • Move your current solution into that folder,
  • Load up the solution in Visual Studio
  • Use AnkhSvn to add it again. It should pick up the fact that it's in a subversioned directory and allow you to do that.
來不及說愛妳 2024-08-28 14:24:30

您还可以右键单击解决方案或项目,然后在 Subversion 菜单上提供“切换项目”选项

使用 ankhsvn 更改 subversion 服务器名称

Also you can right click on solution or project and on the Subversion menu the option "switch project" is available

subversion server name change with ankhsvn

最单纯的乌龟 2024-08-28 14:24:30

尝试转到“文件”>“颠覆>更改源代码管理...并更改 SCC 绑定 URL。

编辑:
我发现这是不可编辑的。为此,您可能需要进入命令行。

在您的基本目录中,发出此 svn 命令:

svn switch --relocate http://old.repo.location http://new.repo.location

当然,使用您的特定 URL。我建议您阅读 switch 命令,以便您确定自己在做什么。当您重新打开 VS 时,AnkhSVN 应该会获取新的绑定。如果您通过“文件”> 添加了解决方案Subversion 菜单中,您可能需要编辑 .sln 文件。只需在文本编辑器中打开它,然后将所有旧存储库 URL 更改为新 URL。

您还可以安装 TortoiseSVN 并使用上下文菜单发出“重新定位”命令。
这将是最简单的。

当然,在进行任何这些更改之前备份您的目录。

Try going to File > Subversion > Change Source Control... and changing the SCC Binding URL.

EDIT:
I see that's not editable. You may need to drop to the command line for this.

In your base directory, issue this svn command:

svn switch --relocate http://old.repo.location http://new.repo.location

with your speific URLs, of course. I'd recommend reading up on the switch command so you're sure of what you're doing. When you reopen VS, AnkhSVN should pick up the new bindings. If you've added the solution through the File > Subversion menu, you may need to edit the .sln file. Just open it in a text editor and change all of your old repository URLs to the new URL.

You could also install TortoiseSVN and use the context menu to issue the Relocate command.
This will be the easiest.

Back up your directory before any of these changes, of course.

笨笨の傻瓜 2024-08-28 14:24:30

另一种方法是编辑“.svn”文件夹中的 wc.db(SQLite 文件),其中包含存储库 URL。
我使用了 Firefox 插件 SQLITE 编辑器,然后在表 REPOSITORY 中只有 1 行表示您的存储库 URL,将其更改为新主机即可。

我的情况是,我有新计算机和新主机,因此添加到 SVN 存储库的所有项目都有旧 URL(旧主机名)。

Other way is to edit wc.db (SQLite file) in your ".svn" folder, which contains repository URL.
I used Firefox addon SQLITE editor, then in table REPOSITORY is only 1 row saying your repository URL, change it to new host and there you go.

My case was that I have new computer with new HOST, so all my projects added to SVN repository had and old URL (old hostname).

仅此而已 2024-08-28 14:24:30

我从 SVN“导出”,然后对 SVN 存储库浏览器中的存储库执行“添加文件夹”操作,然后在 Visual Studio 中打开 .sln。

I "exported" from SVN, then did an "Add Folder" to the new repo in the SVN Repo Browser, then opened the .sln in Visual Studio.

隔纱相望 2024-08-28 14:24:30

就我而言,我必须更改 SVN 的 URL,因为 DNS 不知道主机名,所以我必须使用 IP 地址。

您可以编辑位于以下位置的 hosts 文件:
C:\Windows\System32\drivers\etc

只需输入一行

xxx.xxx.xxx.xxx     hostname

In my case I had to change the URL of the SVN because the DNS didn't know about the hostname so I had to use the IP address.

You can edit your hosts file located under:
C:\Windows\System32\drivers\etc

And simply enter a line like

xxx.xxx.xxx.xxx     hostname
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文