寻找使用 git-format-patch 和 git am 的工作流程示例
我正在考虑让我的学生使用 git 进行结对编程。 由于学生的工作必须保密,因此不可能公开回购。 相反,每个学生都会有一个他们自己维护的私人存储库,并且他们需要使用 git-format-patch 交换补丁。 我已阅读手册页,但我有点不清楚将发送哪些补丁。 对于学生来说,显而易见的事情是发送自上次发送以来的所有补丁或者(如果 git 不介意重复接收相同的补丁)发送自黎明以来的所有补丁 >。 (请记住,这些是学生项目,它们持续几周且规模较小,并且表现不是标准。)我们最好的朋友是简单,我们喜欢蛮力也是如此。
谁能给我一系列简短的示例,显示两个人,每个人都有一个私人 git 存储库,使用 git-format-patch 和 git-am 交换补丁? 或者向我指出现有的 git 文档和/或教程?
I'm thinking of asking my students to use git for pair programming. Because student work has to be secret, a public repo is out of the question. Instead, each student will have a private repo they maintain themselves, and they will need to exchange patches using git-format-patch. I've read the man page but I'm a little unclear which patches will be sent. The obvious thing for the students would be send all patches since the last send or (if git doesn't mind receiving the same patches redundantly) send all patches since the dawn of time. (Remember these are student projects, they last for a couple of weeks and are small, and performance is not a criterion.) Our best friend is simplicity and we are fond of brute force as well.
Can anyone give me a short series of examples that show two people, each with a private git repo, exchanging patches using git-format-patch and git-am? Or alternatively point me to existing git documentation and/or tutorial?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果他们可以看到彼此的 git 存储库,效果最好。 git 本身就是这样管理的(人们可以参考一个公共存储库,然后他们从那里格式化补丁)。 如果人们从未看到彼此的存储库,事情就会有点困难......
他们可能做的一件事是维护对上次进行格式补丁的引用。 假设他们首先发送整个树(包括 .git):
这种形式的 git tag 会创建一个“轻量级标签。它是一种书签。这将是人们保存的一种简单方法跟踪他们发送的内容,以便他们下次可以再次发送
:
It works best if they can see each other's git repos. git itself is managed this way (there's a public repo people can reference, and then they format-patch from there). If people never see each other's repos, things are a bit more difficult...
One thing they may do is maintain a reference to the last time they did a format patch. Let's say they start by just sending their entire tree (including .git):
git tag
in this form creates a "lightweight tag. It's a sort of bookmark. This will be an easy way for people to keep track of what they sent so they can send it again next time.On the other side:
看来
git bundle
是更好的选择。 与单向通信工作流程 git format-patch 不同,bundle 允许您利用与公共遥控器相同的工作流程,但与直接访问分开。它专为运动鞋网而设计,非常适合学生将其保存到 USB 或电子邮件包中。
补丁更多的是由项目负责人的沟通方式提交审批。
It seems that
git bundle
is the better option. Unlikegit format-patch
which is a one-way communication workflow, bundle allows you to leverage the same workflow you use with public remotes but are separated from direct access.It is designed for sneaker-nets and would be perfect for students to save to USB or email bundles.
patches are more for submit for approval by a project lead style of communicating.