使用所有分支恢复 gitlab 备份存储库捆绑文件

restore gitlab backup repository bundle file with all branches

我需要从 gitlab 备份恢复一些存储库。此备份包含所有存储库的 .bundle 文件。如何恢复包含所有分支的完整存储库?

如果我运行 git bundle list-heads myfile.bundle我可以看到所有的分支。

我想使用所有分支在本地恢复该存储库以将其推送到 new/empty gitlab 存储库。

我已经尝试使用 git 克隆,git 使用我能找到的所有其他技巧,但这只会导致一个只有主分支的回购。

如果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.