Skip to content

Instantly share code, notes, and snippets.

@MatejLach
Created September 10, 2018 12:41
Show Gist options
  • Save MatejLach/d16dabadd50f976af0b529ac5e1d9be4 to your computer and use it in GitHub Desktop.
Save MatejLach/d16dabadd50f976af0b529ac5e1d9be4 to your computer and use it in GitHub Desktop.
Restore code from GitLab .bundle files
#!/bin/bash
RESTORE_FOLDER = /path/to/the/folder/where/you/want/the/code
for i in $(find `pwd` -name *.bundle); do
git clone --mirror $i $(RESTORE_FOLDER)/$(basename $i .bundle).git
cd $(RESTORE_FOLDER)
mkdir $(basename $i .bundle)
cd $(basename $i .bundle).git
git archive master | (cd ../$(basename $i .bundle) && tar x)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment