Skip to content

Instantly share code, notes, and snippets.

@cuzz22000
Last active August 2, 2016 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuzz22000/10e474ed913712f2040ca347fb189903 to your computer and use it in GitHub Desktop.
Save cuzz22000/10e474ed913712f2040ca347fb189903 to your computer and use it in GitHub Desktop.
Migrate git-scm to Git Hub

Pull the repositoy that you want to migrate

$> git clone <url-to-repo>

You can either create the target repository through the UI or use hub from the command line.

$> hub create -p <organization or username>/<name of repo>

Switch the origin repository to the one you just created.

$> git remote set-url origin git@github.com:<organization or username>/<name of repo>.git

Confirm that it was switched

$> git remote -v
origin	git@github.com:<organization or username>/<name of repo>.git (fetch)
origin	git@github.com:<organization or username>/<name of repo>.git (push)

Push the source to master in the new repository

$> git push --set-upstream origin master

That's it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment