Skip to content

Instantly share code, notes, and snippets.

Last active August 5, 2016 11:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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