1

I'm on a shared hosting (huge mistake). I have ssh'ed into it and trying to clone a private repository from bitbucket.org:

git clone git@example.com:MyStuff/private-repository.git

but facing this issue:

socket: Address family not supported by protocol

ssh: connect to host bitbucket.org port 22: Address family not supported by protocol

Now looking at this page: https://forums.gentoo.org/viewtopic-t-127306-start-0.html. I think maybe I need to disable the use of ipv6 by ssh to connect to the host. I can't do that (shared hosting).

Any help?

Community
  • 1
  • 1
Sumit Wadhwa
  • 2,825
  • 1
  • 20
  • 34
  • 1
    Can you modify your own `~/.ssh/config`? otherwise you should be able to set `GIT_SSH_COMMAND` to pass `-4` to ssh. See [this question](https://stackoverflow.com/q/7772190) for more. – Hasturkun Jan 05 '20 at 15:47
  • You should definitely complain to your hosting provider, because they've deliberately broken their systems by compiling out IPv6 support in order to increase their profit margins. Lots of software written in the past 15 years just won't work on such a system. – bk2204 Jan 06 '20 at 03:08
  • @bk2204 I did. They're (GoDaddy) pushing me to go for a vps instead – Sumit Wadhwa Jan 06 '20 at 07:30
  • what about clone with ssl [https], it may work.. – Oded BD Jan 06 '20 at 19:03
  • @OdedBD yeah it works. I guess that's the only way to go. – Sumit Wadhwa Jan 06 '20 at 19:09
  • @JayWadhwa so I will post as answer so it could help others – Oded BD Jan 06 '20 at 19:17

1 Answers1

0

I would use clone over SSL in such case, like so

git clone https://<repo-url>

another nice trick if you don't want to type your password each time, you can use credential helper like so:

git config --global credential.helper cache
git config --global credential.https://github.com.username foo
git clone https://github.com/foo/repository.git

The above will cause Git to ask for your password once every 15 minutes (by default).

Oded BD
  • 2,788
  • 27
  • 30