空提交Git补丁 [英] Git patch of empty commits

查看:132
本文介绍了空提交Git补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个空的提交:

pre $ $ git commit --allow-empty -m重要的东西

有时它很有用,例如以协调2(或更多)不同的Git树。



然而,当我

  $ git format-patch ... 

空的提交被省略,因为它们不是与任何代码diff相关联。
有没有办法在补丁中包含空提交?
在此先感谢!

解决方案

您可以传递 - 始终 git format-patch ,但 git am 不会理解如何应用它。


I create an empty commit:

$ git commit --allow-empty -m "something important"

Sometimes it is useful, e.g. to coordinate 2 (or more) distinct git trees.

However, when I

$ git format-patch ...

Empty commits are omitted, as they are not associated with any code diff. Is there a way to include empty commits in a patch ? Thanks in advance !

解决方案

You can pass --always to git format-patch, but git am won't understand how to apply it still.

这篇关于空提交Git补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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