【问题标题】:How to create a patch in Git since last commit?自上次提交以来如何在 Git 中创建补丁?
【发布时间】:2014-02-02 01:07:18
【问题描述】:

我可以使用什么命令来创建一个包含自上次推送以来提交的补丁文件?

谢谢, 导航

【问题讨论】:

  • 你试过搜索吗?如果有,哪个 google 搜索请求不适合您?

标签: git push format-patch


【解决方案1】:

要为topic 分支、所有未推送的提交生成单独的补丁,

git fetch
git format-patch origin/topic..topic

生成的补丁可以使用git apply

要生成一个摘要补丁而不是单个补丁,您可以只保存git diff 的输出,

git fetch
git diff origin/topic..topic > topic.patch

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-05
    • 2014-11-28
    • 1970-01-01
    • 2011-01-18
    • 2011-10-03
    • 1970-01-01
    • 2012-03-12
    • 2015-02-12
    相关资源
    最近更新 更多