SVN 中的补丁有什么用?

发布于 2024-07-15 02:45:54 字数 89 浏览 5 评论 0原文

我猜它允许您“保存”合并过程,以便我可以为某些开源项目创建补丁,并提交补丁,这样他们就不必自己处理合并?

您何时以及如何在 SVN 中使用补丁?

I'm guessing it allows you to "save" a merge process so I could create a patch for some Open Source project, and submit a patch so they don't have to handle the merge themselves?

When and how would you use patches in SVN?

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

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

发布评论

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

评论(2

心奴独伤 2024-07-22 02:45:54

补丁(svn 中的统一 diff 文件)用于各种情况:

  1. 您没有提交访问权限,但您对想要包含的项目进行了一些修改。 在这种情况下,您可以根据修改创建补丁并将补丁文件发送给具有提交访问权限的人员。 当然,这并不意味着他们会提交您的补丁,但这使他们更容易这样做。
  2. 您有尚未提交的修改。 然后,您将补丁文件发送给其他人,以便他们可以查看您的修改并对其发表评论。

补丁文件在其他情况下也很有用,但这些都是针对项目的。

如果不使用补丁文件,您必须完整发送所有修改过的文件,这通常会产生更大的 (zip) 文件。

当然,可以将补丁文件应用到已经有自己的修改的工作副本 - 如果您发送整个文件,这些本地修改将被覆盖。

patches (unified diff files in svn) are used for various situations:

  1. You don't have commit access, but you have some modifications to a project which you want to get included. In that case, you create a patch from your modifications and send the patch file to the ones who have commit access. Of course that doesn't mean that they will commit your patch, but it makes it easier for them to do so.
  2. You have modifications which you don't want to commit yet. You then send the patchfiles to others so they can review your modifications and comment on them.

There are other situations where patchfiles are useful, but those are most very specific to projects.

Without using patchfiles, you'd have to send all your modified files in whole, which usually results in a much bigger (zip) file.

And of course, it's possible to apply a patchfile to a working copy which already has its own modifications - if you would send whole files those local modifications would get overwritten.

独﹏钓一江月 2024-07-22 02:45:54

补丁由无法直接访问 SVN 存储库的人员使用。 他们将其发送给 SVN 用户之一,他/她可能会也可能不会将其合并到 SVN 存储库。

Patches are used by people who don't have direct access for SVN repository. They send it to one of SVN users and he/she may or may not merge it to SVN repository.

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