查看patch:
git apply --stat patch.patch
查看patch能否干净顺利的应用到当前分支中:
git apply --check patch.patch
应用patch
git apply --reject patch.patch
git am patch.patch
git am --signoff < patch.patch
生成patch
git foramt-patch -s 4e16u78j32 #某次提交后的所有patch,-s signed off
git foramt-patch -1 #单次提交
git foramt-patch -3 #从head往前的3个提交内容,
git foramt-patch -n 07ef #-n指patch数,07ef对应提交的名称,某次提交(含)之前的几次提交
git foramt-patch -1 commit-id #为选定的commit-id生成补丁
git foramt-patch HEAD^ #最近一次的提交
git foramt-patch HEAD^^ #最近二次的提交
git foramt-patch HEAD^^^ #最近三次的提交
git foramt-patch HEAD^^^^ #最近四次的提交
git-patch的使用
最新推荐文章于 2024-08-06 18:16:28 发布