allstar allstar - 1 year ago 63
Git Question

Push to github from local, cloned from another repo

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?

Answer Source

You can change the remote or add another one.

To change the remote

git remote set-url origin

To add a secondary remote as e.g. other_origin

git remote add other_origin

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download