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

    1.仓库中,master上开出一个新的branch,暂定为alex。

    2.git checkout alex

       vim file

       git add file

       git commit -m "1st modify --- alex branch"

    3.git show-branch --more=4 alex

      [alex] 1st branch modify alex
      [alex^] creat test file.

    4. 创建patch。

        git format-patch -1 

        或者 :

         git format-patch alex^..alex

     5. git checkout master

         git apply *.patch

         git apply *new.patch

    至此,patch成功地打入到master上。

    Note:

    1.请注意,git apply 是一个事务性操作的命令,也就是说,要么所有补丁都打上去,要么全部放弃。

    2.对于传统的 diff 命令生成的补丁,则只能用 git apply 处理。

       对于 format-patch 制作的新式补丁,应当使用 git am 命令。

  • 相关阅读:
    C语言文法
    实验一
    词法分析
    py中文词频统计
    py字符串练习
    py画了个国旗
    熟悉常用的Linux操作
    大数据概述
    实验三、 递归下降分析程序实验
    简易c语言LL(1)文法
  • 原文地址:https://www.cnblogs.com/viewcozy/p/5054003.html
Copyright © 2011-2022 走看看