问题描述
假设网络访问是零星的,没有中央服务器,那么使用 git 保持三个或更多分支同步的最佳方法是什么?有没有办法只提取我的增量,通过电子邮件发送这些,然后在另一端合并它们?
Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end?
推荐答案
虽然git format-patch"和git am"是管理来自非 git 源的补丁的好方法,但对于 git 存储库,您应该调查git bundle".
While "git format-patch" and "git am" are great ways to manage patches from non-git sources, for git repositories you should investigate "git bundle".
git bundle"和子命令create"和unbundle"可用于创建和使用增量提交的二进制 blob,可用于通过替代文件传输机制跨弱"链接传输分支历史记录(例如电子邮件、蜗牛邮件等).
"git bundle" and the subcommands "create" and "unbundle" can be used to create and use a binary blob of incremental commits that can be used to transfer branch history across a 'weak' link via an alternative file transfer mechanism (e.g. email, snail-mail, etc.).
git bundles 将保留提交 ID,而 format-patch/am 不会导致目标提交不相同(不同的 SHA1).
git bundles will preserve commit ids, whereas format-patch/am will not resulting in the destination commits not being identical (different SHA1s).
这篇关于通过电子邮件 Git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!