Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


[migration script] GitHub projects to GitLab #44

wants to merge 1 commit into from

5 participants

Ivan Lisenkov Valeriy Sizov Achilleas Pipinellis Malte N Adonis K.
Ivan Lisenkov

Please see my script, for automatically mirroring all user's github repos to gitlab instance

Ivan Lisenkov

Nobody interested?

Valeriy Sizov

sorry ;) This is good feature. Many people have asked for this. Gitlab team will check your request as soon as possible ;)

Achilleas Pipinellis

@ivlis Since now gitlab supports namespaces, could you modify your script? It is good for merge.

Achilleas Pipinellis


Achilleas Pipinellis


Achilleas Pipinellis axilleas referenced this pull request

[WIP] New repository structure #111

12 of 14 tasks complete
Achilleas Pipinellis axilleas was assigned
Adonis K.

This would be really great to have

Achilleas Pipinellis

Closed in favor of #156

Achilleas Pipinellis axilleas closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 21, 2013
  1. Add github to gitlab migration script

    Ivan Lisenkov authored
This page is out of date. Refresh to see the latest.
Showing with 53 additions and 0 deletions.
  1. +14 −0 github/
  2. +39 −0 github/
14 github/
@@ -0,0 +1,14 @@
+Migrate your repositories from github to gitlab
+1. Edit for your credentials
+2. Add your ssh key to ssh-agen if you have an encrypted key
+3. run ./
+If you want to migrate only private repos from github add
+"type=private" to github url.
+Unfortunaty, gitlab API doens't support namespaces yet, so all
+created repositories are prefixed for security
39 github/
@@ -0,0 +1,39 @@
+GITHUB_USER=user # Your username on github
+GITHUB_PASSWORD='' # Your password on github
+GITLAB_PREFIX=from-github # All repos created on gitlab will be prefixed
+GITLAB_USER=user # Your username on your gitlab instance # Your gitlab host WITHOUT SCHEMA
+GITLAB_TOKEN= # Your gitlab token
+TMP=`mktemp -dp .`
+cd $TMP
+curl -s -u "$GITHUB_USER:$GITHUB_PASSWORD" -i '' |\
+ grep ssh_url > private_repos.txt
+while read line
+ url=`echo $line | sed -r 's|^\s*"(.*)":\s"(.*)",*$|\2|'`
+ repo=`echo $url | sed -r 's|^.*/(.*)$|\1|'`
+ repo_name=`echo $repo | sed -r 's|^(.*).git$|\1|'`
+ curl -s -X POST -H "private-token: $GITLAB_TOKEN" \
+ -d " {\"name\" : \"$GITLAB_PREFIX-$repo_name\" } "\
+ "https://$GITLAB_HOST/api/v3/projects"
+ echo $url
+ git clone --bare $url $repo
+ cd $repo
+ echo "Pushing to URL: $push_url"
+ git push --mirror $push_url
+ cd ..
+done < private_repos.txt
+cd ..
+rm -rf $TMP
Something went wrong with that request. Please try again.