简体   繁体   中英

Trying to clone a repo using git protocol leads to https error?

I'm trying to clone a repo over a local network using the git protocol, but am receiving the following error:

~/foobar$ git clone git://192.168.xxx.yyy/
Cloning into '192.168.xxx.yyy'...
fatal: unable to access 'https://192.168.xxx.yyy/': Failed to connect to 192.168.xxx.yyy port 443: Connection refused

A coworker was successfully able to clone using exactly the same command using a mac as a client (I'm using Ubuntu). Any idea why git clone seems to be trying to use https, or how to fix this?

You specify to use the git-protocol in your git clone command, but the error shows that git tried to use https.

This is probably an issue in your git client configuration. If your .gitconfig contains the following remove it

[url "https://"]   
    insteadOf = git://

See: https://coderwall.com/p/sitezg/force-git-to-clone-with-https-instead-of-git-urls

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM