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. centos 6.4 apache开启gzip方法

    系统概况,主机CentOS6.4  Apache2.4 php5.3.6 mysql5.5 开始:首先得确认apache是否已经加载了mod_deflate模块 1.httpd -M 在结果中查看是否 ...

  2. C#中DataTable与实体集合通用转换(使用扩展方法)

    本案例提供了:把DataRow转换为单个实体.dataTable转换为List泛型支持时间格式转换. 下文的方法都是扩展方法.扩展方法要求写在静态类中,方法也要静态. 它必须在一个非嵌套.非泛型的静态 ...

  3. iOS开发网络篇—大文件的多线程断点下载(转)

    http://www.cnblogs.com/wendingding/p/3947550.html   iOS开发网络篇—多线程断点下载 说明:本文介绍多线程断点下载.项目中使用了苹果自带的类,实现了 ...

  4. Wireshark 入门

    1.过滤目的地是百度的IP包. 百度的ip: 命令:ip.src eq 61.135.169.125 过滤ip来源是61.135.169.125 ip.dst eq 61.135.169.125 过滤 ...

  5. Careercup - Facebook面试题 - 5344154741637120

    2014-05-02 10:40 题目链接 原题: Sink Zero in Binary Tree. Swap zero value of a node with non-zero value of ...

  6. ios 开发常用快捷键

    CTRL + K 删除一行,尽量在行首处使用: CMD+ /  注释,取消注释 CMD + R  运行 CMD + . 停止运行 CMD + F   普通搜索 CMD + CTRL + ↑/↓ 切换头 ...

  7. C#根据日期DateTime和持续时间int找到日期

    protected DateTime GetFinish(DateTime start, int duration) { return start.AddDays(duration); } prote ...

  8. mac上eclipse上配置hadoop

    在mac上安装了eclipse之后,配置hadoop其实跟在linux上配置差不多,只是mac上得eclipse和界面和linux上得有点不同. 一:安装eclipse eclipse得安装比较简单, ...

  9. Asp.Net缓存(2)

    缓存页的多个版本 ASP.NET 允许在输出缓存中缓存同一页的多个版本.输出缓存可能会因下列因素而异: 初始请求 (HTTP GET) 中的查询字符串. 回发时传递的控制值(HTTP POST 值). ...

  10. POJ 2948 Martian Mining(DP)

    题目链接 题意 : n×m的矩阵,每个格子中有两种矿石,第一种矿石的的收集站在最北,第二种矿石的收集站在最西,需要在格子上安装南向北的或东向西的传送带,但是每个格子中只能装一种传送带,求最多能采多少矿 ...