Last active
December 28, 2017 15:48
-
-
Save mauricios/31c1ced33b3cde47d1140b21bd3b91dc to your computer and use it in GitHub Desktop.
Migrate Git repo from one remote to another
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
#!/bin/bash | |
# Clone the old repo using the mirror option | |
git clone --mirror [email protected]:my-old-repo.git | |
# Enter the new clonned repo directory | |
cd my-old-repo.git | |
# Add the new remote repo | |
git remote add new_origin [email protected]:my-new-repo.git | |
# Push to the new repo using mirror option | |
git push new_origin --mirror |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment