gitgitlabgit-bundle

restore gitlab backup repository bundle file with all branches


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?

If I run git bundle list-heads myfile.bundle I can see all the branches.

I want to restore that repo locally with all branches to push it to a new/empty gitlab repository.

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.


Solution

  • 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
    

    Note the .git since the --mirror would create a bare repo.