Skip to content

Instantly share code, notes, and snippets.

Last active Aug 5, 2016
What would you like to do?
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.
# Adds a remote called 'github' to your repository
git remote add github
# Bare, mirrored push to 'github' remote repository
git push -mirror github
# clone a bare, mirrored repository
git clone --mirror
# Change origin to new URL
git remote set-url --push origin
# 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