Created
June 8, 2018 17:51
-
-
Save giovannibonetti/440e1e93994c64650318538dcdb5d7ea to your computer and use it in GitHub Desktop.
Useful for migrating between git hosting services
This file contains hidden or 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
#!/usr/bin/env bash | |
# Step 1: clone the repository from the old remote | |
# Step 2: add the new remote | |
# Based on https://gist.github.com/grimzy/a1d3aae40412634df29cf86bb74a6f72 | |
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all | |
git push --all new-remote |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment