Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git over Email?

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?

like image 279
Alexandra Franks Avatar asked Sep 17 '08 16:09

Alexandra Franks


People also ask

What is a git email?

The git send-email command is used to send patches that are generated with git format-patch over email. We go through an example of contributing to a project by sending patches with the git send-email tool in Public Project over Email.

Why does git require an email?

It is explained in the Git SCM ebook: http://git-scm.com/book/en/v1/Getting-Started-First-Time-Git-Setup. And because pull request could be made by sending patch by email. This way you are sure that people could communicate together (and email is the simplest thing that guarantee the identity of someone...)


1 Answers

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" 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 will preserve commit ids, whereas format-patch/am will not resulting in the destination commits not being identical (different SHA1s).

like image 50
CB Bailey Avatar answered Oct 02 '22 11:10

CB Bailey