Change git origin
Scenario:
you checkout a remote github repo as read-only:
git clone git://github.com/yourusername/oneofyourrepo
After you work on the local working directory for a while you decide that you would want to be able to push the changes back to github.
The easiest way is to either:
1) run the follow command on the root of the working directory:
git config remote.origin.url git@github.com:yourusername/oneofyourrepo
2) edit .git/config, look for section [remote "origin"] and change the url to
git@github.com:yourusername/oneofyourrepo
If you have already added the ssh public key of the host that you are working on to github.com, you should now be able to push the changes.
Credit goes to: http://stackoverflow.com/questions/3011402/leaving-github-how-to-change-the-origin-of-a-git-repo
Advertisement
Categories: git