Can't clone any repository using git

I tried cloning a few repositories, but always get the same error. Where can I find some more information about this error (an error log file or something similar) or maybe someone knows what can be wrong?

# git clone http://github.com/creationix/nvm.git .nvm
Initialized empty Git repository in /home/marcin/.nvm/.git/
error:  while accessing http://github.com/creationix/nvm.git/info/refs

fatal: HTTP request failed

or

  • How to “connect” a git repository without cloning it first?
  • git: automatically run bash script ON THE SERVER after any client pushes
  • VM / Dev problems for Mac/Windows development with PHP/MySQL/GIT
  • Install Omnibus Gitlab on subdomain
  • cent os bash unrecognized option --system on adduser command
  • Pushing git repo files to server
  • # git clone https://gitlab.com/jmis/exilecraft.git
    Initialized empty Git repository in /home/marcin/exilecraft/.git/
    error:  while accessing https://gitlab.com/jmis/exilecraft.git/info/refs
    
    fatal: HTTP request failed
    

    I’m using CentOS 6.8 and Git 1.7.1

    ———- EDIT
    after upgrade Git to 2.12.0 I have error message:

    # git clone https://github.com/creationix/nvm.git .nvm
    Cloning into '.nvm'...
    fatal: unable to access 'https://github.com/creationix/nvm.git/': Problem with the SSL CA cert (path? access rights?)  
    

  • Should I gitignore my .gitignore?
  • Unable to run git clone from git.videolan.org
  • GIT picking up whitespace changes it shouldn't
  • Is there a way to extract folders from a repo with full history?
  • Correct process for performing multiple git remote pushes
  • Bitbucket git process ensure master only
  • 2 Solutions collect form web for “Can't clone any repository using git”

    That error is clearly described in HTTPS cloning errors

    Depending on the exact error message, trying to clone with your username in the url can help:

    git clone https://<username>@github.com/<username>/<repo.git>
    

    But ideally, you should recompile and install a more recent version of Git.

    With Git version 2.12.0, the error message is:

    fatal: unable to access 'https://github.com/creationix/nvm.git/': 
    Problem with the SSL CA cert 
    

    Make sure you have installed the certificates:

    sudo yum reinstall openssl ca-certificates -y
    

    The manual version of this fix is:

    mkdir -p /etc/pki/tls/certs
    curl https://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/ca-bundle.crt
    git config --global http.sslcainfo /etc/pki/tls/ca-bundle.crt
    git config -l 
    

    Another approach is described here:

    mkdir /usr/src/ca-certificates && cd /usr/src/ca-certificates
    wget http://mirror.centos.org/centos/6/os/x86_64/Packages/ca-certificates-2015.2.6-65.0.1.el6_7.noarch.rpm
    rpm2cpio ca-certificates-2015.2.6-65.0.1.el6_7.noarch.rpm | cpio -idmv
    cp -pi ./etc/pki/tls/certs/ca-bundle.* /etc/pki/tls/certs/
    

    There can be a variety of reasons (proxy, firewall, company policy and more).
    As far as i know github has removed the support for the http and now only support https

    Change the protocol to ssh and it will work without any problems.

    There is a very detailed document on how to do it.
    https://help.github.com/articles/connecting-to-github-with-ssh/

    To summarize it:

    • Generate ssh key locally
      open git-bash/terminal and generate the key ssh-keygen
    • Copy the key cat ~/.ssh/id_rsa.pub
    • open git hub ans paste the key under your profile settings
    • Clone with the ssh url instead of the http/https.

    Login to your github account

    • In the upper-right corner of any page, click your profile photo, then click Settings.

    enter image description here

    • In the user settings sidebar, click SSH and GPG keys

    enter image description here.

    • Click New SSH key or Add SSH key.

    enter image description here

    • Paste your key into the Key field.

    enter image description here

    • Click Add SSH key.

    enter image description here

    • If prompted, confirm your GitHub password.

    enter image description here

    Git Baby is a git and github fan, let's start git clone.