小编use*_*719的帖子

从捆绑备份恢复git存储库

我创建了我的git存储库的备份,如如何备份本地Git存储库?建议用

git bundle create /tmp/foo-all --all
Run Code Online (Sandbox Code Playgroud)

我可以看到所有的引用都在那里,包括由git-svn创建的远程引用.现在我无法弄清楚如何将此捆绑包再次恢复到本地存储库.我很确定我已经做过一次了.我尝试了git-clone,但这给了我一个只有一个存储库,我的备份包作为远程仓库.

我也试过了

git init
git bundle unbundle /tmp/foo --all 
Run Code Online (Sandbox Code Playgroud)

但这只列出了所有参考资料......

验证捆绑包给出:

$ git bundle verify $somewhere/foo.bundle 
The bundle contains 12 refs
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/master
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/heads/xxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs/remotes/git-svn
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HEAD
The bundle requires these 0 ref
$somewhere/foo.bundle is okay
Run Code Online (Sandbox Code Playgroud)

git backup restore

31
推荐指数
4
解决办法
3万
查看次数

标签 统计

backup ×1

git ×1

restore ×1