【发布时间】:2014-02-24 09:38:40
【问题描述】:
关于 git 存储库导出和导入的 SO 上有一些类似的帖子,但所有答案都不完整。所以我在这里提出单独的问题。
我在 Eclipse 中使用 EGIT 来处理 git SCM。
如何将 git 存储库导出到 zip 文件/文件夹(包含所有分支、标签和历史记录) 并在 Eclipse 中导入相同的存储库?
我试过了,
git archive HEAD --format=zip >~/abc.zip 但在 eclipse 中重新导入时它不起作用。
还有其他方式可以导入和导出 git 仓库吗?
编辑
看了@VonC 的答案后,我做了这个
git bundle create ~/abc.bundle --all
-
git bundle list-heads ~/abc.bundle
裁判/负责人/大师 refs/remotes/origin/branch1 refs/remotes/origin/branch1 refs/remotes/origin/branch3 refs/remotes/origin/master refs/remotes/origin/branch4 ...... 参考/标签/标签1 参考/标签/标签2 参考/标签/标签3 .... git clone -b master ~/abc.bundle ~/newrepo/xyz/
但是当我尝试在 eclipse 中导入这个 git repo 时,我只得到 master 分支,因为我在克隆时使用了 master。是否可以在一个命令中克隆所有分支?
【问题讨论】:
标签: git import repository export egit