Git 使用补丁
跟进我之前的问题Git 工作流程与未经验的成员。 我选择让他向我发送补丁。 问题是我以前没有使用过补丁,并且找不到解释工作流程的教程。
我想要的是让他从仓库中提取最新的代码。 创建一个分支工作,当他完成后提交他的更改,我希望他为它创建一个补丁,这样我就可以将它集成到master中。
你能告诉我如何在这种情况下创建补丁并将其应用到我的主人上吗?
To follow up on my previous question Git work flow with an inexpirenced member.
I choose to have him send patches to me. The problem is i haven't used patches before and i can't find tutorials giving explanation on the work flow.
What i want is have him pull the latest code from the repo. create a branch work on it commit his changes when he is done i want him to create a patch for it so i can integrate it into master.
Can you tell me how can i create patches in a situation like this and apply it to my master?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 git-format-patch 创建补丁(1),或者,如果您想发送电子邮件,只需 git-send-email(1).
然后使用 git-apply(1) 或者,对于电子邮件,git-am(1 )。
Create patch with git-format-patch(1), or, if you want to send emails just git-send-email(1).
Then apply it with git-apply(1) or, for email, git-am(1).
这相对容易。 假设分支是 foo,补丁来自 master:
请注意,由于提交者的差异,它不会为您提供与原始版本相同的修订版本。 在这种情况下,情况会稍微复杂一些(http://home.regit.org/?page_id=32 )
That's relatively easy. Say the branch is foo, and the patches from master:
Note that it won't give you the same revisions as the original because of commiters differences. That's a bit more complicated in that case (http://home.regit.org/?page_id=32)
无需提交:
然后他可以通过电子邮件将补丁发送给您。
如果他确实承诺了,那么只需给 diff 一些论据即可。
那么你只需这样做:
without commiting:
then he can email you the patch.
if he does commit, then just give diff some arguments.
then you just do: