如何将 gist 中的补丁应用到 Django 源代码?
I want to try out a patch on gist that modifies the source code of Django:
How do I do it? I have never used git so a step by step instruction would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
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 likepatch -p1 < downloaded-patch.diff
.You may want to experiment with the
-p
argument if it fails; -p tellspatch
to strip some of the directory prefix for each file in the diff (look at the first line in the diff).