2 way to do it
first: -
git remote set-url <name> <newurl>
example: -
git remote set-url origin git@github.com:username/test.git
second: -
What you need to do is change the "origin" setting. You are editing the .git / config file at the root of your project, which might look something like this:
... [remote "origin"] url = git://user@dev.foo.com/git/repos/path fetch = +refs/heads/*:refs/remotes/origin/* ...
or if your 'remote' is actually local:
... [remote "origin"] url = /path/to/repos/on/this/machine fetch = +refs/heads/*:refs/remotes/origin/* ...
All you have to do is edit this file with your favorite editor and change the url = setting to a new location. Assuming the new repository is configured correctly and you have the correct URL, you will happily push and pull to and from the new remote location.
Sumit Singh Apr 09 '12 at 6:11 2012-04-09 06:11
source share