【问题标题】:git format-patch without committinggit format-patch 不提交
【发布时间】:2011-12-11 20:10:20
【问题描述】:

如何在 HEAD 和暂存区域之间生成补丁(无需提交)?

例如

echo text > some.file
git add some.file
git format-patch (what-the-sha?)..HEAD

我必须先提交然后重置吗?

【问题讨论】:

    标签: git patch


    【解决方案1】:
    git diff --cached
    

    如果您只想要补丁差异,应该可以解决问题。

    但是,如果您真的想要 format-patch 的所有功能,您确实应该提交(毕竟,如果您要向上游提交补丁,您需要提交消息)。

    【讨论】:

      猜你喜欢
      • 2018-07-02
      • 2012-06-27
      • 1970-01-01
      • 2013-05-17
      • 2010-10-11
      • 1970-01-01
      • 2023-03-31
      • 2011-06-03
      • 1970-01-01
      相关资源
      最近更新 更多