Created
March 10, 2021 00:52
-
-
Save MatheusR42/6c0c27fe33ee073de406aaed16b3f60f to your computer and use it in GitHub Desktop.
Commands to migrate all branchs and tags to other git server
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
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done | |
git fetch --all && git pull --all | |
git remote set-url origin <repo-url> | |
git push --all && git push --tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment