没有提交的git格式补丁 [英] git format-patch without committing
本文介绍了没有提交的git格式补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在HEAD和暂存区域之间生成补丁(无需提交)?
例如
echo text> some.file
git add some.file
git format-patch(what-the-sha?).. HEAD
我必须提交然后重置吗?
解决方案
git diff --cached
如果您只需要patch diff, p>
如果你确实需要 format-patch
的所有功能,那么你真的应该提交(毕竟,你如果您要向上游提交补丁,则需要提交消息)。
How can I generate the patch between HEAD and the staging area (without committing)?
e.g.
echo text > some.file
git add some.file
git format-patch (what-the-sha?)..HEAD
Do I have to commit then reset?
解决方案
git diff --cached
should do the trick if you just want the patch diff.
If you really want all of the functionality of format-patch
, though, you really should commit (after all, you want a commit message if you're submitting a patch upstream).
这篇关于没有提交的git格式补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文