如何将 gist 中的补丁应用到 Django 源代码?

发布于 2024-09-16 02:18:35 字数 179 浏览 1 评论 0原文

我想尝试一个修改 Django 源代码的 gist 补丁:

gist: 550436

怎么做我做吗?我从来没有使用过 git,所以如果能提供一步一步的指导,我将不胜感激。

I want to try out a patch on gist that modifies the source code of Django:

gist: 550436

How do I do it? I have never used git so a step by step instruction would be greatly appreciated.

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

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

发布评论

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

评论(1

薯片软お妹 2024-09-23 02:18:35

您可以使用 patch 来应用差异。确保您位于 django 源目录(或您想要应用补丁的任何位置),然后运行 ​​patch -p1 patch -p1 patch -p1 patch -p1 patch -p1 patch -p1 <下载的补丁.diff

如果失败,您可能想尝试使用 -p 参数; -p 告诉 patch 去除 diff 中每个文件的一些目录前缀(查看 diff 中的第一行)。

You can use patch to apply diffs. Make sure you're in your django source directory (or wherever you want to apply the patch), and run something like patch -p1 < downloaded-patch.diff.

You may want to experiment with the -p argument if it fails; -p tells patch to strip some of the directory prefix for each file in the diff (look at the first line in the diff).

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