git - 我如何通过电子邮件向某人发送 git 存储库?

标签 git

我试过:

git archive HEAD --format=zip > archive.zip

:然后我通过电子邮件发送 archive.zip,在另一端他们将 archive.zip 解压缩到一个文件夹中。但是当他们尝试任何 git 命令时,他们发现这不会生成有效的 git 存储库

最佳答案

你可以使用 git bundle 并通过电子邮件发送一个文件

参见“backing up project which uses git

A git bundle is just one file which can be very easily created and again imported as it can be treated like another remote.

收到后,您可以克隆它或从该文件中获取。

如“Backup of github repo”中所述,您可能希望第一封电子邮件与所有 分支捆绑在一起:

$ git bundle create /tmp/foo-all --all

作为Andreas在评论中提到, Scott Chacon 最近(2010 年 3 月)在 ProGit blog 上写了一篇关于这个主题的“可爱”文章:

Git's Little Bundle of Joy

关于git - 我如何通过电子邮件向某人发送 git 存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2545765/

相关文章:

git - Hudson checkout 卡在 'git fetch'

java - 通过 Java 使用用户名和密码通过 ssh 克隆 git 存储库

Git - 如何在给定日期获取第一个提交 sha1

windows - Windows 重新安装后 git stash 不工作

git - 当目录已添加时将文件添加到 git

git - msysgit 和 Cygwin + git 的区别?

git rebase : "Could not apply (hash)." I'm lost

java - 使用 REST API 复制或复制 Bitbucket 中的存储库

git - "heroku git:clone -a myapp"结果为 "` git :clone ` is not a heroku command."

git - 当文件已经从 fs 中删除时,从 git index 中删除文件