Wednesday, September 9, 2015

Change git remote from SSH to HTTPS

Peace be upon you.. My office has strict network rules which filtered by proxy on port 8080 and does not allow me to use SSH connection to fetch and pull on my git repository. I tried to use subversion a.k.a svn as alternative but I not familiar with the command and GUI tool such RapidSVN on linux are not very helpful. Then, I google-fu and found that git support HTTPS connection too! Wohaa..good!

Let's check our current remote repository URL:
$ git remote -v
Now change our remote's URL from SSH to HTTPS with the git remote set-url command:
$ git remote set-url origin https:[email protected]/wawang/sistem_repo.git
* I use Bitbucket as example above, means it depends on your git hosting provider
* Bitbucket URL format : https://<username>@bitbucket.org/<username>/<reponame>.git
* Github URL format : https://github.com/<username>/<reponame>.git

Now, verify the remote repository URL using the git remote -v command. Easy right? That all,Peace!

No comments:

Post a Comment