8

I'm using SSH at the moment when connecting to Bitbucket and suddenly the port 22 where Bitbucket uses has been blocked so I decided to use HTTPS option instead. How to disable the ssh in git bash and use HTTPS instead? I already reinstalled git but it still it uses SSH/Putty to connect.

Thanks.

Sebastian
  • 7,670
  • 5
  • 38
  • 50
lincx
  • 399
  • 2
  • 5
  • 15

1 Answers1

13

It's not at git settings, but in your repository settings.

You need to change the address of your remote repository and specify the https:// protocol

git remote set-url origin <repo-https-url>

However with https you'll have to type your password on each push/pull operation, but see Is there a way to skip password typing when using https:// on GitHub?.

Community
  • 1
  • 1
CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • works like charm thanks! my mindset is to get rid of ssh where I should only just have to change the remote url lol. – lincx Mar 04 '13 at 00:10
  • now my next problem is getting rid of the annoying password prompt :) – lincx Mar 04 '13 at 00:10
  • I have a submodule with a URL starting with `https://github.com/` but when I run `git submodule update --init` it tries to use SSH, it says `Host key verification failed.` and `fatal: clone of 'git@github.com:`. What else do I have to change to make it use HTTPS? – Aaron Franke Jul 20 '23 at 15:51