Files
tldr/pages.zh/common/git-format-patch.md

17 lines
565 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# git format-patch
> 准备 .patch 文件。将提交通过邮件发送到其他地方时很有用。
> 另请参见 `git am`,它可以应用生成的 .patch 文件。
> 更多信息:<https://git-scm.com/docs/git-format-patch>。
- 为所有未推送的提交创建一个自动命名的 `.patch` 文件:
`git format-patch {{origin}}`
- 将两个修订版本之间的所有提交写入 `.patch` 文件并输出到 `stdout`
`git format-patch {{revision_1}}..{{revision_2}}`
- 为最新的 3 个提交写入 `.patch` 文件:
`git format-patch -{{3}}`