Skip to content

Instantly share code, notes, and snippets.

@castaneai
Created January 8, 2019 02:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save castaneai/626099e13a497c2e727ad17440ec2f9f to your computer and use it in GitHub Desktop.
Save castaneai/626099e13a497c2e727ad17440ec2f9f to your computer and use it in GitHub Desktop.
Migrating private repo to GitHub from GitLab.
#!/bin/bash
GITLAB_USER=castaneai
GITHUB_USER=castaneai
REPO_NAME=$1
git clone --mirror https://gitlab.com/$GITLAB_USER/$REPO_NAME && cd $REPO_NAME.git && hub create -p $REPO_NAME && git remote set-url origin https://github.com/$GITHUB_USER/$REPO_NAME.git && git push --mirror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment