git-patch的使用

查看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^^^^	#最近四次的提交

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值