源代码控制 - 开源项目

发布于 2024-11-02 17:52:43 字数 395 浏览 5 评论 0 原文

我遇到了一个常见的困境。

很多时候,我们公司依赖使用开源库来完成工作,但有时我们必须修改它们以使其在不同平台上运行、修复错误等。

我们使用 subversion 的组合:TortoiseSVN 和 AnkhSVN。

有没有办法让以下场景使用 SVN:

  • 开发人员将开源项目的源代码添加到我们的 subversion(通常通过导出,具体取决于他们使用的源代码控制)
  • 开发人员对开源代码进行了一些更改
  • 开源项目创建者自己进行了一些改进和错误修复
  • 我们如何将开源项目的更改合并到我们的颠覆中?

如果 SVN 不能做到这一点,我们是否有更好的源代码控制选项?如果可能的话,我们更喜欢与 Visual Studio 集成的产品。

I have run into a common dilemma.

Many times, our company relies on using open source libraries to get things done, but occasionally we have to modify them to get it to run on different platforms, fix bugs, etc.

We use a combination of subversion: TortoiseSVN, and AnkhSVN.

Is there a way for the following scenario to work with SVN:

  • Devs adds the source code from an open source project to our subversion (usually via export, depending on what source control they use)
  • Devs make several changes to the open source code
  • Open source project creator makes several improvements and bug fixes of their own
  • How do we merge the changes from the open source project to our subversion?

If SVN can't do this, is there a better source control option for us? We would prefer one with Visual Studio integration if possible.

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

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

发布评论

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

评论(2

单身狗的梦 2024-11-09 17:52:43

Subversion 当然可以做到这一点。这种事情在分布式 VCS 出现之前就已经发生了。请参阅 供应商分支 部分://svnbook.red-bean.com/en/1.8/svn.branchmerge.html" rel="nofollow">Subversion 书中的第 4 章分支和合并。

引用:

管理供应商分支通常是这样工作的:首先,您创建一个顶级目录(例如/vendor)来保存供应商分支。然后,将第三方代码导入到该顶级目录的子目录中。然后将该子目录复制到主开发分支(例如,/trunk)的适当位置。您始终在主开发分支中进行本地更改。对于您跟踪的代码的每个新版本,您都可以将其引入供应商分支并将更改合并到 /trunk 中,从而解决本地更改和上游更改之间发生的任何冲突。

Subversion can do this of course. This kind of stuff was happening before distributed VCSs existed. See Vendor Branches section from Chapter 4. Branching and Merging in Subversion book.

Quote:

Managing vendor branches generally works like this: first, you create a top-level directory (such as /vendor) to hold the vendor branches. Then you import the third-party code into a subdirectory of that top-level directory. You then copy that subdirectory into your main development branch (e.g., /trunk) at the appropriate location. You always make your local changes in the main development branch. With each new release of the code you are tracking, you bring it into the vendor branch and merge the changes into /trunk, resolving whatever conflicts occur between your local changes and the upstream changes.

泪眸﹌ 2024-11-09 17:52:43

Subversion 在这里不是合适的工具。您正在寻找的内容需要一个分布式版本控制系统,这基本上意味着您可以跨存储库拉动和推送,并且没有中央存储库。

查看 Git 和 Mercurial 了解更多信息。如果上游项目使用 Subversion,您可以使用 git-svn 作为桥梁 - 您创建自己的存储库,更改内容,并且您仍然可以将 svn 合并到其中以及推送到您自己的“上游/中央”git 存储库。

另请注意:您是否有理由不直接将更改贡献给项目? (特别是如果该项目获得了 GPL 或 LPGL 等许可,这迫使您在适当的许可下向公众发布修改后的源代码,许多项目都是如此)。这似乎是回馈那些免费为您提供代码的人的好方法...

以下问题针对 Git + Visual Studio:将 Git 与 Visual Studio 结合使用

Subversion is not the right tool here. What you are looking for requires a Distributed Version Control System, which basically means you can pull and push across repositories, and there's no central repository.

Check out Git and Mercurial for more information. If the upstream project uses Subversion, you can use git-svn as a bridge - you create your own repository, change stuff, and you can still merge the svn into it as well as push to your own "upstream/central" git repository.

Also note: Is there a reason you don't contribute your changes directly to the project? (Especially if the project is licensed under something like GPL or LPGL that forces you to release your modified source to the public under a suitable license, which many projects are). It seems that would be a great way to give back to the people that are giving you code for free...

The following question addresses Git + Visual Studio: Using Git with Visual Studio

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