如何通过电子邮件向某人发送 git 存储库? [英] How can I email someone a git repository?
问题描述
我试过了:
git archive HEAD --format=zip > archive.zip
:然后我通过电子邮件发送 archive.zip,在另一端他们将 archive.zip 解压缩到一个文件夹中.但是当他们尝试任何 git 命令时,他们发现这不会产生有效的 git 存储库
:and then I email archive.zip and at the other end they unzip archive.zip into a folder. But when they try any git commands they find out that this does not produce a valid git repository
推荐答案
你可以使用 git bundle
并通过电子邮件发送一个文件
You could use git bundle
and email one single file
参见备份使用 git 的项目"
一个 git bundle 只是一个文件,可以很容易地创建和再次导入,因为它可以像另一个远程一样对待.
A git bundle is just one file which can be very easily created and again imported as it can be treated like another remote.
收到后,您可以克隆它或从该文件中提取.
Once received, you can clone it or fetch from that file.
如github 存储库的备份"中所述,您可能需要与所有分支进行捆绑的第一封电子邮件:
As mentioned in "Backup of github repo", you will probably want for the first email to make your bundle with all branches:
$ git bundle create /tmp/foo-all --all
正如 Andreas 在评论中提到的那样,Scott Chacon 最近(2010 年 3 月)写了一篇可爱"的文章.ProGit 博客中关于此主题的文章:
As Andreas mentions in the comments, Scott Chacon recently (March 2010) wrote a "cute" article on this topic in the ProGit blog:
这篇关于如何通过电子邮件向某人发送 git 存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!