单个解决方案可以保存来自多个存储库的项目吗?

发布于 2024-09-04 22:29:05 字数 388 浏览 3 评论 0原文

我已经开始设置 SVN 存储库来存储我的代码,并且想知道单个 Visual Studio 解决方案是否可以拥有来自多个存储库的项目。我有一个共享库,其中包含不同的辅助函数、通用自定义控件等,它们由多个项目使用,并托管在其自己的存储库中。然后我有我的项目存储库,其中包含所有特定于程序的代码,例如表单等。我知道我可以将共享库复制到程序的存储库中,然后在进行更改时将它们复制回来,但我更愿意将它们保存在不同的存储库中,这样我就可以点击“提交”,通用库会提交到它的存储库,并且程序代码也会提交到它。我目前正在使用 AnkhSVN,但如果可以使用其他工具,我会研究它。


对所有“只使用一个存储库”答案的先发制人的澄清:共享库托管在一个在线存储库中,任何人都可以查看,但程序代码是专有的并且驻留在我们的办公室服务器上,因此它们需要不同的存储库。

I've begun setting up SVN repositories to store my code, and am wondering if a single Visual Studio solution can have projects from multiple repositories. I have a shared library with different helper functions, generic custom controls, etc, that are used by multiple projects, and hosted in its own repository. Then I have my project repository, which contains all of the program-specific code such as forms, etc. I know I could copy the shared library into the program's repository, then copy them back when I make changes, but I'd much rather keep them in different repositories so I can hit "Commit" and the general library commits to it's repository, and the program code commits to it. I'm currently using AnkhSVN, but if it's possible with other tools, I'll look into it.


Preemptive clarification for all the "just use one repository" answers: The shared library is hosted in an online repository, viewable by anyone, but the program code is proprietary and resides on our office servers, so they need different repositories.

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

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

发布评论

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

评论(2

少钕鈤記 2024-09-11 22:29:05

是的,可以,尽管您一次只能从一个存储库提交项目。实现此目的并使其可由任何签出项目的开发人员重现的一种方法是使用解决方案根文件夹上的 svn:externals 属性来从其他存储库中提取项目。

要编辑或添加此属性,您可以使用 svn 命令行或 TortoiseSVN。您可以在 Subversion 红皮书中找到有关 svn:externals 属性本身的更多详细信息

Yes it can, though you'll only be able to commit to projects from one repository at a time. One way of achieving this and making it reproducible by any developer who checks out your project is to use the svn:externals property on your solution's root folder to pull in projects from other repositories.

To edit or add this property, you can either use the svn command line, or TortoiseSVN. You'll find more details on the svn:externals property itself in the Subversion red book.

尘曦 2024-09-11 22:29:05

正如大卫所说,这是可能的。

我想补充一点,拥有多个存储库不仅会剥夺原子提交的能力,而且您也无法将项目及其依赖项分支/标记为单个标记或分支。由于这些原因,我不建议使用多个存储库。

Like David says this is possible.

I would like to add to this that having multiple repositories not only takes away the ability to atomically commit, but also you won't be able to branch/tag the project and its dependencies into a single tag or branch. I wouldn't recommend using multiple repositories for these reasons.

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