0

If you have already cloned someone else's repo (rather than forking) and have been committing locally, what's the appropriate way to push that into a new remote repo on GitHub?

allstar
  • 1,155
  • 4
  • 13
  • 29
  • Is the remote repo a fork (clicking the fork button on GitHub) or a new empty repo? – kennytm Oct 31 '16 at 15:39
  • Possible duplicate of [Change the URI (URL) for a remote Git repository](http://stackoverflow.com/questions/2432764/change-the-uri-url-for-a-remote-git-repository) – George Hilliard Oct 31 '16 at 16:03

1 Answers1

2

You can change the remote or add another one.

To change the remote

git remote set-url origin https://www.something.com/my_repo.git

To add a secondary remote as e.g. other_origin

git remote add other_origin https://www.something.com/my_repo.git

If you changed origin you can git push to the new remote. If you added another remote, you can specify during git push which remote you want to push to.

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218