当前位置:   article > 正文

git生成patch文件_git format-patch的补丁名字

git format-patch的补丁名字



1  使用git format-patch生成所需要的patch:
当前分支所有超前master的提交:
git format-patch -M master
某次提交以后的所有patch:
git format-patch 4e16                --4e16指的是commit名
从根到指定提交的所有patch:
git format-patch                          --root 4e16
某两次提交之间的所有patch:
git format-patch 365a..4e16      --365a和4e16分别对应两次提交的名称


2 应用patch:
先检查patch文件:git apply --stat newpatch.patch
检查能否应用成功:git apply --check  newpatch.patch
打补丁:git am --signoff < newpatch.patch

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/487069
推荐阅读
相关标签
  

闽ICP备14008679号