Skip to content

Instantly share code, notes, and snippets.

@cmcculloh
Created August 14, 2013 15:06
Show Gist options
  • Save cmcculloh/6231934 to your computer and use it in GitHub Desktop.
Save cmcculloh/6231934 to your computer and use it in GitHub Desktop.
Migrate from one remote to another for a given repo
# replace <repo> with the name of the repository to be migrated
# replace <remote-from-url> with the url of the repository to be migrated from
# replace <remote-to-url> with the url of the repository to be migrated to
git init --bare temp<repo>
cd temp<repo>
git remote add from <remote-from-url>/<repo>.git
git remote add to <remote-to-url>/<repo>.git
git fetch from 'refs/*:refs/*'
git push to 'refs/*:refs/*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment