gpt4 book ai didi

git - 如何生成包含提交 SHA 的补丁?

转载 作者:行者123 更新时间:2023-12-03 09:07:27 25 4
gpt4 key购买 nike

我有两个人

  • Bob,继续与其团队一起开发项目
  • Alice,她正在度假,她的笔记本电脑远离 Bob 的办公室

Bob 希望向 Alice 发送 Alice 离开后主分支的差异

我一开始也这么认为

bob $ git format-patch --stdout e6def65..master > history.patch

alice $ git am history.patch

会保留提交哈希,但事实并非如此。

是否有一种解决方案可以通过电子邮件轻松交换保留提交 SHA 的差异?

最佳答案

git bundle做你想做的事?

Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly connected, and therefore the interactive Git protocols (git, ssh, http) cannot be used. This command provides support for git fetch and git pull to operate by packaging objects and references in an archive at the originating machine, then importing those into another repository using git fetch and git pull after moving the archive by some means (e.g., by sneakernet). As no direct connection between the repositories exists, the user must specify a basis for the bundle that is held by the destination repository: the bundle assumes that all objects in the basis are already in the destination repository.

另请参阅this previous question关于通过电子邮件发送 Git。

关于git - 如何生成包含提交 SHA 的补丁?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45921595/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com