Created
April 20, 2015 09:01
-
-
Save richardh-vccp/e0e70b6078d2fb75df6a to your computer and use it in GitHub Desktop.
GitHub to GitLab Backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
token=ENTERYOURTOKEN | |
namespace_name=ENTERNAMESPACENAME | |
namespace_id=ENTERNAMESPACEID | |
repo=$1 | |
git clone --mirror [email protected]:vccp/$repo.git && | |
cd $repo.git && | |
git remote set-url origin [email protected]:$namespace_name/$repo.git && | |
curl --header "PRIVATE-TOKEN: $token" --data "name=$repo" --data "namespace_id=$namespace_id" http://gitlab.vccphub.com/api/v3/projects && | |
git push origin && | |
cd .. && | |
rm -rf $repo.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment