如何在HEAD和暂存区域之间生成补丁(不提交)?
例如
echo text > some.file
git add some.file
git format-patch (what-the-sha?)..HEAD
Run Code Online (Sandbox Code Playgroud)
我必须提交然后重置吗?
git diff --cached
Run Code Online (Sandbox Code Playgroud)
如果你只是想要补丁差异应该做的伎俩.
但是,如果您真的想要所有功能format-patch,那么您真的应该提交(毕竟,如果您要向上游提交补丁,则需要提交消息).