我像在 How to backup a local Git repository? 中创建了我的 git 存储库的备份建议的 与
git bundle create /tmp/foo-all --all
我可以看到所有引用都在那里,包括由 git-svn 创建的远程引用。 现在我不知道如何将这个包再次恢复到本地存储库。 我很确定我已经做过一次了。我尝试了 git-clone 但这只给了我一个存储库,其中包含我的备份包作为远程存储库。
我也试过
git init
git bundle unbundle /tmp/foo --all
但这只是列出了所有的引用...
验证包给出:
$ 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
最佳答案
简答:
$ git bundle verify $somewhere/foo.bundle
$ git clone $somewhere/foo.bundle
Cloning into 'foo'...
Receiving objects: 100% (10133/10133), 82.03 MiB | 74.25 MiB/s, done.
Resolving deltas: 100% (5436/5436), done.
$ cd foo
$ git status
...
Lazy Badger 是这么说的,但它在最后一段。 :)
关于git - 从 bundle 备份恢复 git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9807367/