zoukankan      html  css  js  c++  java
  • git format-patch 用法

    git format-patch HEAD^

    # git format-patch -s 1bbe3c8c197a35f79bfddaba099270a2e54ea9c7

    please replace the hash code with your repo previous commit.

    then you can find the patch under repo directory.

    then mail your patch to configuration admin. 

    # git format-patch -M master         // 当前分支所有超前master的提交
     
    # git format-patch -s 4e16                // 某次提交以后的所有patch, --4e16指的是SHA1 ID
     
    # git format-patch -1                     //  单次提交
    # git format-patch -3                    // 从master往前3个提交的内容,可修改为你想要的数值
    # git format-patch –n 07fe            // -n指patch数,07fe对应提交的名称, 某次提交(含)之前的几次提交

    # git format-patch -s --root origin     // 从origin到指定提交的所有patch
     
    应用patch:
    先检查patch文件:# git apply --stat newpatch.patch
    检查能否应用成功:# git apply --check  newpatch.patch
    打补丁:# git am --signoff < newpatch.patch

    (使用-s或--signoff选项,可以commit信息中加入Signed-off-by信息)

    或git am

  • 相关阅读:
    JSON
    什么是Jsonp?
    用border做三角形
    前端模块化
    Web 前端
    前端性能优化
    Ajax的原理
    node.js基础语法
    【真·新手初篇】菜鸟们都戳进来看看(欢迎大神指导)
    2019.11.20 开启一天的工作
  • 原文地址:https://www.cnblogs.com/Ph-one/p/6674684.html
Copyright © 2011-2022 走看看