You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minhajuddin edited this page Dec 27, 2011
·
1 revision
Use the script below to export your existing git repositories to gitlabhq
#!/bin/bash#get these two values from your browsers request headers when you login to *your* gitlab website
cookie='Cookie: remember_user_token=**'
csrf='X-CSRF-Token: **='
gitlab_host='git.dev'#substitute with IP if your server doesn't have a domain nameforrin$(cat repos)do
repo=$(echo $r| cut -d':' -f 1)
path=$(echo $r|cut -d':' -f 2)echo$repoecho$path
curl -H $cookie -H $csrf -H 'X-Requested-With: XMLHttpRequest' -d "project[name]=$repo&project[path]=$repo&project[code]=$repo&project[description]=$repo" -i "http://$gitlab_host/projects"cd$path
git remote add gitlab "git@$gitlab_host:$repo.git"
git push gitlab master
#git push gitlab --all #comment out the above line and uncomment this one if you want to push all branchesdone
create a file named repos with the following content