如何使用git 生成patch 和打入patch

https://blog.csdn.net/liuhaomatou/article/details/54410361
https://www.jianshu.com/p/e5d801b936b6

1. patch

git format-patch --commit
git format-patche 795fefabc

2. appy

先检查patch文件:git apply --stat newpatch.patch
检查能否应用成功:git apply --check newpatch.patch
打补丁:git am --signoff < newpatch.patch (使用-s或--signoff选项,可以commit信息中加入Signed-off-by信息)
git apply --reject --ignore-whitespace ~/patch/patch/test.diff 2>&1 | tee ~/patch/patch/testdiff.log``
gnore-whitespace是忽略多余的空格。
在使用git am之前, 你要首先git am --abort 一次,来放弃掉以前的am信息,这样才可以进行一次全新的am。

3 冲突解决:

git apply --reject PATCH
$ edit edit edit
(译注:根据.rej文件手动解决所有冲突)
找到文件改成 -

$ git add FIXED_FILES
$ git am --continue

转载于:https://www.cnblogs.com/widic/p/9115974.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值