Skip to content

Instantly share code, notes, and snippets.

@MatheusR42
Created March 10, 2021 00:52
Show Gist options
  • Save MatheusR42/6c0c27fe33ee073de406aaed16b3f60f to your computer and use it in GitHub Desktop.
Save MatheusR42/6c0c27fe33ee073de406aaed16b3f60f to your computer and use it in GitHub Desktop.
Commands to migrate all branchs and tags to other git server
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