问题描述
我需要从 gitlab 备份中恢复一些存储库.此备份包含所有存储库的 .bundle 文件.如何恢复包含所有分支的完整存储库?
I need to restore some repositories from an gitlab backup. This backup contains .bundle files for all the repos. How can I restore the complete respository with all branches in it?
如果我运行 git bundle list-heads myfile.bundle
我可以看到所有的分支.
If I run git bundle list-heads myfile.bundle
I can see all the branches.
我想使用所有分支在本地恢复该存储库,以将其推送到新的/空的 gitlab 存储库.
I want to restore that repo locally with all branches to push it to a new/empty gitlab repository.
我尝试过使用 git clone、git pull 我能找到的所有其他技巧,但这只会导致一个只有 master 分支的 repo.
I've tried to use git clone, git pull all other tricks i could find but that only leads to a repo with only the master branch in it.
推荐答案
如果 bundle 是用所有分支创建的,您应该能够在 git clone --mirror
:
If the bundle was create with all branches, you should be able to see all the branches after a git clone --mirror
:
git clone --mirror /path/to/your/bundle yourRepo.git
注意 .git
,因为 --mirror 会创建一个 bare repo.
Note the .git
since the --mirror would create a bare repo.
这篇关于使用所有分支恢复 gitlab 备份存储库捆绑文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!