Skip to content

Instantly share code, notes, and snippets.

@mjuchli
Created May 3, 2017 17:47
Show Gist options
  • Save mjuchli/52779025cc297054888032296aca8119 to your computer and use it in GitHub Desktop.
Save mjuchli/52779025cc297054888032296aca8119 to your computer and use it in GitHub Desktop.
Migration from Gitlab to Github
#!/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