如何使用git am从电子邮件中应用补丁? [英] How to use git am to apply patches from email messages?

查看:412
本文介绍了如何使用git am从电子邮件中应用补丁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对git非常熟悉(基本东西atleast分支,合并,与同伴等的合作等),但是有一天我的一个朋友告诉我,我们可以在我们的邮箱中使用git。
涉及的软件包是git-am(手册页在这里)。

请有人帮我开始使用git-am。

解决方案

涉及的另一件大事是 git format-patch 。这将创建通过电子邮件发送的补丁;然后可以使用 git send-email 或直接。例如:

 #为来自原始主人的每次提交创建一个补丁到您
git format-patch origin / master .. master

#现在发送它们...
#这里有一个zillion选项,还有一些配置;阅读手册页
git send-email --to=maintainer@project.com --from=me@here.com ... * .patch

git am 将接受由 format-patch 创建的补丁,并依次应用它们例如:

  git am * .patch 

你必须弄清楚如何从邮件客户端自己导出mbox格式的补丁,不过我想你也可以简单地将它们作为附件发送或直接传输。



您可以在一个存储库中完全自己尝试一下,看看它是如何工作的。如上创建一组补丁,然后检查出发点,并使用 git am 来应用补丁。


I am pretty familiar with git(the basic stuff atleast-branches, merges,collaboration with peers etc.) but the other day a friend of mine told me that we could use git with our mailbox. The package involved is git-am (manual page here).

Please could someone help me get started with git-am.

解决方案

The other big thing involved is git format-patch. This will create the patches to be emailed; they can then be sent using git send-email or directly. For example:

# create a patch for each commit from origin's master to yours
git format-patch origin/master..master

# now send them... 
# there are a zillion options here, and also some configuration; read the man page
git send-email --to=maintainer@project.com --from=me@here.com ... *.patch

git am will accept the patches created by format-patch, and apply them sequentially, for example:

git am *.patch

You'll have to figure out how to export the patches in mbox format from your mail client yourself, though I suppose you could also simply send them as attachments or transfer them directly.

You can try this out for yourself entirely within one repository to see how it works. Create a set of patches as above, then check out the starting point, and use git am to apply the patches.

这篇关于如何使用git am从电子邮件中应用补丁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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