在git中,如何为最后的2+版本创建单个补丁? [英] In git, how do I create a single patch for the last 2+ revisions?

查看:109
本文介绍了在git中,如何为最后的2+版本创建单个补丁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  git format-patch -2 
我想为后面的2个版本创建一个补丁。

为我提供了2个补丁文件,每个修订版都有一个补丁文件

  git format-patch HEAD〜2..HEAD 

给出

  git format-patch -1 HEAD〜2..HEAD 



会给出一个文件,但只包含上次修订版本的变更。



有没有如何在git中执行此操作?

解决方案

  git diff HEAD〜2..HEAD> ; my-patch.diff 

它不会有格式补丁的每个提交元数据。


I would like to create a patch for the last 2 revisions.

git format-patch -2

gives me 2 patch files, one for each revision

git format-patch HEAD~2..HEAD

gives the same thing.

git format-patch -1 HEAD~2..HEAD

gives a single file, but only contains changes for the last revision.

Is there any way to do this in git?

解决方案

git diff HEAD~2..HEAD > my-patch.diff

It won't have any of format-patch's per-commit metadata, though.

这篇关于在git中,如何为最后的2+版本创建单个补丁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆