Last active
August 5, 2016 11:57
-
-
Save sgmeyer/08dd70ab28fca53aeaef6de028918eba to your computer and use it in GitHub Desktop.
Adds a remote repository to an existing repository. This can be used for transferring repositories to multiple Git providers. It can also be useful for sharing code.
This file contains 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
# Adds a remote called 'github' to your repository | |
git remote add github https://github.com/your_username/your-git-repository.git | |
# Bare, mirrored push to 'github' remote repository | |
git push -mirror github |
This file contains 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
# clone a bare, mirrored repository | |
git clone --mirror https://github.com/your_username/your-git-repository.git | |
# Change origin to new URL | |
git remote set-url --push origin https://github.com/your_username/your-git-repository.git | |
# Push repository to new origin and retain history | |
git push --mirror |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment