Generate patch through git diff

http://stackoverflow.com/questions/1191282/how-to-see-the-changes-between-two-commits-without-commits-in-between

you can simply pass the 2 commits to git diff like :

-> git diff 0da94be  59ff30c > my.patch
-> git apply my.patch

error: cannot apply binary patch to 'UKERecognition/UKIncentive.Web/static/img/rose.jpg' without full index line

https://stackoverflow.com/questions/17152171/git-cannot-apply-binary-patch-without-full-index-line

Checkout the branch from which you want to create the patch. Run this command:

git diff-index 79fd4d7 --binary > ~/Desktop/my-patch

Where 79fd4d7 is a placeholder for the commit that came right before the range of commits you want to diff. (e.g. I want a patch that contains the first three commits below:

No such file or directory

https://drupal.stackexchange.com/questions/13387/applying-a-patch-doesnt-work

It is possible that the patch was rolled before the days of Git on drupal.org.

For old patches:

patch -p0 < thepatch.patch

For new patches that mysteriously fail with git apply:

patch -p1 < thepatch.patch

git diff show file name only

https://stackoverflow.com/questions/9848347/can-i-make-git-diff-only-show-the-changed-file-names-and-line-numbers/55225156#55225156

clu@WASYGSHA01-1020 MINGW64 /c/repository/GitHub/ChuckLu/Test/HearthbuddyRelease (master)
$ git diff --stat
JitProfiles/JitProfile.jpf | Bin 25040 -> 16040 bytes
Routines/DefaultRoutine/Silverfish/ai/CardDB.cs | 396 +++
.../DefaultRoutine/Silverfish/ai/ComboBreaker.cs | 32 +-
.../Silverfish/behavior/control/_mulligan.txt | 16 -
.../DefaultRoutine/Silverfish/data/_carddb.txt | 2562 +++++++++++++++++++-
Settings/Global/GlobalSettings.json | 2 +-
6 files changed, 2974 insertions(+), 34 deletions(-)

用git difff 生成补丁的更多相关文章

  1. git diff 与git format-patch 生成补丁包

    git diff commit_id 会生成最后一次提交到目前修改过的内容补丁 git diff commit_id1 commit_id2 会生成两次提交之间修改过的内容补丁 git format- ...

  2. git如何生成单个文件的补丁

    背景:有时候碰到一个commit包含了好几个文件的修改,但是我只需要其中一个文件的修改内容,那么这时候就需要以下方法来生成这一个文件对应修改内容的补丁 答:git format-patch " ...

  3. git diff比较版本差异(生成补丁)

    1.git diff [<options>] <commit> <commit> options 使用--name-only(git diff HEAD cd504 ...

  4. git apply、git am打补丁.diff 和 .patch【转】

    本文转载自:https://www.jianshu.com/p/e5d801b936b6 前提: 生成patch: git format-patch -M master 生成指定patch,0163b ...

  5. diff生成补丁与patch打补丁

    1.使用diff生成补丁: diff是Linux下的文件比较命令,参数这里就不说了,直接man一下就行了,不仅可以比较文件,也可以比较两个目录,并且可以将不同之处生成补丁文件,其实就是一种打补丁的命令 ...

  6. 多个git账户生成多份rsa秘钥实现多个账户同时使用配置

    下文分享一个多个git账户生成多份rsa秘钥实现多个账户同时使用配置例子了,这个例子非常的好用对于有多个git的朋友有不小的帮助. 使用过git的童鞋应该对id_rsa秘钥不陌生,总得用github吧 ...

  7. Git简单生成生成公钥和私钥方法

    Git简单生成生成公钥和私钥方法 Git配置 Git安装完之后,需做最后一步配置.打开git bash,分别执行以下两句命令 git config --global user.name “用户名” g ...

  8. Git密钥生成步骤SSH Key

    顺便推荐下自己的网站: 一个php后台极速开发框架 https://www.lotusadmin.top/ 一个有趣的网站 https://www.waytomilky.com/ Git是分布式的代码 ...

  9. 如何为openwrt生成补丁

    答:使用quilt工具 步骤如下: 1. 配置quilt $cat> ~/.quiltrc <<EOF QUILT_DIFF_ARGS="--no-timestamps - ...

随机推荐

  1. phpstrom 7.0 序列号

    phpstrom 7.0 用户名 www.goipc.cn license key 13748-1204201000001dZdtN0KxZbl8zNH8RHFCz9t"gjKv9yXf2c ...

  2. UML 小结(3)- UML的结构及各个阶段的应用

    UML的结构: 其中各个图的作用如下:     用例图:用来描述用户的需求,从用户的角度描述系统的功能,并指出各功能的执行者,强调谁在使用系统,系统为执行者完成哪些功能. 静态图包括类图跟对象图 类图 ...

  3. JPA学习---第四节:JPA实例与JPA主键生成策略

    1.编写实体类,代码如下: package learn.jpa.bean; import javax.persistence.Entity; import javax.persistence.Gene ...

  4. ubuntu 12.04 搭建nginx + php + mysql +phpmyadmin

    1. 使用官方PPA安装 Nginx 最新版本,使用以下命令:sudo add-apt-repository ppa:nginx/stablesudo apt-get updatesudo apt-g ...

  5. 【BZOJ】【2463】【中山市选2009】谁能赢呢?

    博弈论 这能算博弈论吗…… orz ZYF so sad……窝智商太低 题解搬运: 当n为偶数时,可以被2*1的骨牌完全覆盖,所以每次都走骨牌的另一端,而另一个人只能走新的骨牌,直到没有为止 当n为奇 ...

  6. C# \uxxx Unicode编码解码

    /// <summary> /// Unicode编码 /// </summary> /// <param name="str"></pa ...

  7. sv_target_output dx11

    http://msdn.microsoft.com/en-us/library/windows/desktop/bb509647(v=vs.85).aspx

  8. 【DDD-Apwork框架】事件总线和事件聚合器

    第一步:事件总线和事件聚合器 [1]事件总线 IEventBus IUnitOfWork.cs using System; using System.Collections.Generic; usin ...

  9. ByteArrary(优化数据存储和数据流)

    原地址:http://www.unity蛮牛.com/blog-1801-799.html 首页 博客 相册 主题 留言板 个人资料   ByteArrary(优化数据存储和数据流) 分类:unity ...

  10. netbeans 7安装xdebug调试php程序

    1.下载安装xdebug 先从xdebug官网下载对应php版本的xdebug组件,下载地址是:http://www.xdebug.org/download.php 如果不确定下载哪个版本的xdebu ...