Thursday, July 9, 2015

Chaning git remote tracking repository or url

Here is the example.

$ git remote -v
origin  https://github.com/kolipakakondal/titanium_studio.git (fetch)
origin  https://github.com/kolipakakondal/titanium_studio.git (push)
upstream        https://github.com/appcelerator/titanium_studio_360.git (fetch)
upstream        https://github.com/appcelerator/titanium_studio_360.git (push)

Currently my 'upstream' branch is pointing to a wrong remote url, and I wanted to change it.

$ git remote set-url upstream https://github.com/appcelerator/titanium_studio.git
$ git remote -vorigin  https://github.com/kolipakakondal/titanium_studio.git (fetch)
origin  https://github.com/kolipakakondal/titanium_studio.git (push)
upstream        https://github.com/appcelerator/titanium_studio.git (fetch)
upstream        https://github.com/appcelerator/titanium_studio.git (push)