Skip to content

Instantly share code, notes, and snippets.

@maxivak
Last active May 12, 2021
Embed
What would you like to do?
Restore repo from Gitlab bundle file

Gitlab exports repositories to tar archive which contains .bundle files.

We have repo.bundle file and we want to restore files from it.

  • create bare repo from bundle file
git clone --mirror myrepo.bundle my.git

This will create a folder my.git which contains a bare repository.

Now we will restore data from a bare repo into our folder

mkdir output

cd my.git

git archive master | (cd ../output && tar x)

Now folder output has all files from the repo. We can copy files to any destination.

Misc

  • working with .bundle files
git bundle verify myrepo.bundle

git bundle unbundle myrepo.bundle
@davebeach

This comment has been minimized.

Copy link

@davebeach davebeach commented Apr 22, 2018

Thanks. Needed this

@andreis

This comment has been minimized.

Copy link

@andreis andreis commented Oct 17, 2018

Thank you

@paulgregg

This comment has been minimized.

Copy link

@paulgregg paulgregg commented Dec 28, 2018

Thanks, I've added more details here on restoring it back to a repo with a working tree.
https://gist.github.com/paulgregg/181779ad186221aaa35d5a96c8abdea7

@offsecin

This comment has been minimized.

Copy link

@offsecin offsecin commented Jun 3, 2020

Thanks a lot ,it really helped me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment