zoukankan      html  css  js  c++  java
  • git patch

    [root@localhost libxml2]# patch -pn < 0001-fix-parser-termination-from-Double-hyphen-within-com.patch 
    patch: **** strip count n is not a number
    [root@localhost libxml2]# git apply --stat 0001-fix-parser-termination-from-Double-hyphen-within-com.patch 
     parser.c |    4 ++++
     1 file changed, 4 insertions(+)
    [root@localhost libxml2]# it apply --check   0001-fix-parser-termination-from-Double-hyphen-within-com.patch 
    -bash: it: command not found
    [root@localhost libxml2]# git apply --check   0001-fix-parser-termination-from-Double-hyphen-within-com.patch 
    error: patch failed: parser.c:4955
    error: parser.c: patch does not apply
    [root@localhost libxml2]# git am --signoff < 0001-fix-parser-termination-from-Double-hyphen-within-com.patch 
    Applying: fix parser termination from "Double hyphen within comment" error.
    error: patch failed: parser.c:4955
    error: parser.c: patch does not apply
    Patch failed at 0001 fix parser termination from "Double hyphen within comment" error.
    The copy of the patch that failed is found in:
       /data1/cloud_images/libxml2/.git/rebase-apply/patch
    When you have resolved this problem, run "git am --resolved".
    If you prefer to skip this patch, run "git am --skip" instead.
    To restore the original branch and stop patching, run "git am --abort".
    [root@localhost libxml2]# 
    打入 patch / diff:
    git apply xxx.patch
    git apply xxx.diff
    检查 patch / diff:
    git apply --check xxx.patch
    git apply --check xxx.diff
    若git和需要打patch的文件不在一个目录:(git在framework下,patch要打入frameworks/base/下)
    git apply --check --directory=base/ xxx.patch
    git apply --directory=base/ xxx.patch
    ** git am 后面会说到,以及生产patch和打入patch的一些命令参数**
    1. 检查patch是否可用,没显示文字,就说明可用,且无冲突;
      git apply --check ~/patch/patch/0001-add-11111.patch


     
    链接:https://www.jianshu.com/p/e5d801b936b6
     
  • 相关阅读:
    Java 引用传递和值传递
    jenkins 自动化部署 spring boot 项目(多图)
    Mybatis学习笔记,持续更新
    ubuntu 安装并远程连接redis
    ubuntu redis 集群安装,超简单多图细腻操作
    ubuntu16.04 的 使用笔记
    阿里云 ubuntu16.04 下 ftp 的快速应用(包罗疑难问题解决方案)
    k8s的#容器镜像
    kubectl命令出现【The connection to the server localhost:8080 was refused
    CIDR无类别域间路由
  • 原文地址:https://www.cnblogs.com/dream397/p/13927737.html
Copyright © 2011-2022 走看看