从 SourceTree 创建文件的 git diff
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22297284/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Create a git diff of a file from SourceTree
提问by Lakshmanaprabhu
How to create a patch file from a Source TreeActually, i need to create a patch file of a specific modified file. i can view this using External diff or git diff filename in git bash.
如何从源树创建补丁文件 实际上,我需要创建一个特定修改文件的补丁文件。我可以在 git bash 中使用 External diff 或 git diff 文件名查看这个。
回答by LoicAG
Assuming that this question is about the Git client SourceTree, here's how to create a patch file:
假设这个问题是关于Git客户端SourceTree的,下面是创建补丁文件的方法:
- in the Log/History view, right-click on a commit
- select the context menu option "Create Patch..."
- in the "Create Patch" dialog window, select the commits to include in the patch, choose the location of your patch file on the filesystem, and click "Create Patch".
- 在日志/历史视图中,右键单击提交
- 选择上下文菜单选项“创建补丁...”
- 在“创建补丁”对话框窗口中,选择要包含在补丁中的提交,选择您的补丁文件在文件系统上的位置,然后单击“创建补丁”。
回答by Tung Fam
回答by Serban Constantin
git diff commitid1 commitid2 > patch.diff
git diff commitid1 commitid2 > patch.diff