Skip to content

Instantly share code, notes, and snippets.

@paulgregg
Last active July 7, 2024 03:29
Show Gist options
  • Save paulgregg/181779ad186221aaa35d5a96c8abdea7 to your computer and use it in GitHub Desktop.
Save paulgregg/181779ad186221aaa35d5a96c8abdea7 to your computer and use it in GitHub Desktop.
Converting a gitlab export to simple git repo

Converting a gitlab export to simple git repo

Gitlab exports a tar.gz file which contains a file called project.bundle. We can convert this file into a normal git repo using the following steps:

Extract the project.bundle file

$ tar xvfz GitLabExport.gz
x ./
x ./project.bundle
x ./project.json
x ./VERSION

$ ls -l project.bundle
-rw-r--r--@ 1 pgregg  pgregg  69055 21 Dec 12:06 project.bundle

Restore the bundle to git repo

$ mkdir repo
$ git clone --mirror project.bundle repo/.git
$ cd repo
$ git init
$ git checkout

Check contents

$ git status
On branch master
nothing to commit, working tree clean
$ ls
README.md
@namasikanam
Copy link

Thanks, this is a more beautiful one than the original.

@sveneisenmanndmde
Copy link

thanks. saved us a bunch of time.

@yushine
Copy link

yushine commented Oct 26, 2021

Nice! Well done!!

@adampatterson
Copy link

Is there a fun a fast way to say go over hundreds of them :)

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