Created
May 3, 2017 17:47
-
-
Save mjuchli/52779025cc297054888032296aca8119 to your computer and use it in GitHub Desktop.
Migration from Gitlab to Github
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/bash | |
GITHUB_USER="backender" | |
GITLAB_URL=$1 | |
NAME=$2 | |
cd ~/dev/gitlab | |
git clone $GITLAB_URL | |
cd $NAME | |
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all | |
hub create -p | |
git remote add gh git@github.com:$GITHUB_USER/$NAME.git | |
git push -u --all gh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment