从捆绑备份恢复git存储库 [英] restoring git repository from bundle backup
问题描述
我创建了我的git存储库的备份,就像在如何备份本地Git存储库?建议
与
git bundle create / tmp / foo-all --all
code>
我可以看到所有的裁判都在那里,包括由git-svn创建的远程裁判。
现在我不知道如何将这个包重新还原到本地存储库。
我非常确定我已经做过一次了。我尝试了git-clone,但是这只给我一个存储库和我的备份包作为远程回购。
我也试过了
git init
git bundle unbundle / tmp / foo --all
但这只是列出了所有的参考文献...
验证包给出:
$ git包verify $ somewhere / foo.bundle
该包含12个参考
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs / heads / xxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs / heads / xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs / heads / xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs / heads / xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx参/头/ XXXXXXXXXXXXXX
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx参/头/ XXXX
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx参/头/ XXXX
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx参/头/主
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx参/头/ XXXXXXXX
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs / heads / xxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx refs / remotes / git-svn
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx HEAD
该包需要这些0 ref
$ somewhere / foo.bundle可以
解决方案
$ git bundle verify $ somewhere / foo.bundle
$ git clone $ somewhere / foo.bundle
克隆到'foo'...
接收对象:100% (10133/10133),82.03 MiB | 74.25 MiB / s,完成。
解析三角洲:100%(5436/5436),完成。
$ cd foo
$ git status
...
懒獾说这个,但它在最后一段。 :)
i created backups of my git repository like in How to backup a local Git repository? proposed with
git bundle create /tmp/foo-all --all
I can see all refs are in there, including a remote ref created by git-svn. Now I can't figure out how to restore this bundle to a local repository again. I am quite quite sure i've done it already once. I tried git-clone but that gives me a just a repository with my backup bundle as remote repo.
I also tried
git init git bundle unbundle /tmp/foo --all
but this just lists all references...
Verifying the bundle gives:
$ 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
解决方案Short answer:
$ 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 said this, but it's in the last paragraph. :)
这篇关于从捆绑备份恢复git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!