git clone command is not working?

36,454

Solution 1

An https url should attempt to contact the port 443.

If it tries to contact 8000, that might indicate an intermediate proxy: check git config -l|grep -i proxy, or your environment variable (env or set|grep -i proxy)

You can also try a curl -L -v https://[email protected]/username/reponame.git to have more information.

Finally, don't forget to try and clone through ssh if https does not want to work: see "Set up SSH for Git", and git clone [email protected]:user/repo.git.

Solution 2

Modify your url to use git or ssh protocol for transfer.

e.g. git clone https://github.com/abcd/bashScripts.git

becomes:

git clone [email protected]:abcd/bashScripts.git

Share:
36,454
vimal mishra
Author by

vimal mishra

Updated on September 28, 2020

Comments

  • vimal mishra
    vimal mishra over 3 years

    I am trying to clone bit bucket repo. Once I execute the following command after installing git I am facing following issue :

    $ git clone https://[email protected]/username/reponame.git
    Error :fatal: unable to access'https://[email protected]/username/reponame.git/': 
    Failed to connect to hostname port 8000: Connection refused
    

    How can I get past this error message?

  • VonC
    VonC over 7 years
    @vimalmishra still, I would love to know why git tries to contact the port 8000 when using https... No proxy? Firewall of any kind?
  • vimal mishra
    vimal mishra over 7 years
    I don't know ,Couldn't figure out what was the issue.will update you once I figure out.Still working on!!
  • vimal mishra
    vimal mishra over 6 years
    I think I had some proxy setting under env.After removing those it worked with git clone as well @VonC