Troubleshooting `git clone`

Greg Foster
Greg Foster
Graphite software engineer

When attempting to clone a Git repository, you might encounter a variety of issues that prevent the clone process from executing successfully.These problems can range from network issues to authentication errors.

This guide will walk you through common git clone errors, their causes, and how to resolve them, ensuring you can successfully clone your desired repository.


Terminal Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Cause: This error typically occurs when trying to clone a repository over SSH without having an SSH key added to your GitHub (or other service) account, or when the key is not correctly configured on your machine.


  1. Generate an SSH Key (if you haven't already):

    ssh-keygen -t rsa -b 4096 -C ""

    Follow the prompts to generate your SSH key.

  2. Add the SSH Key to Your SSH Agent:

    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_rsa
  3. Add the SSH Key to Your GitHub Account:

    • Copy your SSH public key to your clipboard:
      cat ~/.ssh/ | clip
    • Go to the New SSH key settings page in GitHub, and paste your key.

    Follow the official documentation on adding SSH keys if you get stuck.

  4. Retry cloning:

    git clone


fatal: repository '' not found

Cause: This error occurs if the repository URL is incorrect, the repository does not exist, or you do not have permission to access it.


  • Check the repository URL: Ensure you've entered the correct URL for cloning.
  • Repository visibility: If the repository is private, ensure you have access to it. For GitHub, you might need to authenticate or use SSH cloning.


fatal: unable to access '': Could not resolve host:

Cause: This is typically a network or DNS issue, where your computer can't resolve the domain name into an IP address.


  1. Check your internet connection: Ensure you're connected to the internet.
  2. Flush Your DNS Cache:
    • On Windows:
      ipconfig /flushdns
    • On macOS and Linux:
      sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder


fatal: unable to access '': SSL certificate problem: unable to get local issuer certificate

Cause: Git can't verify the SSL certificate provided by the remote repository, possibly due to a missing CA bundle on your system. This typically only happens when using a Linux distribution.


  1. Update CA certificates:
    • On Debian/Ubuntu:
      sudo apt-get update && sudo apt-get install ca-certificates
    • On Fedora/CentOS:
      sudo yum update && sudo yum install ca-certificates
  2. Temporarily disable SSL verification (not recommended for security reasons):
    git -c http.sslVerify=false clone
  • Check Git's configuration: Use git config --list to review your Git settings. Misconfigurations, especially with http.proxy or https.proxy, can cause issues.
  • Update Git: Ensure you're using the latest version of Git. Older versions might lack certain bug fixes or features.
  • Use HTTPS Instead of SSH (and vice versa): If one protocol doesn't work, try the other. HTTPS might be more firewall-friendly, for example.

Cloning issues in Git can stem from a variety of sources, including network problems, configuration errors, and permissions issues. By systematically checking the most common causes and applying the fixes outlined above, you can resolve most git clone errors and successfully clone the repository you need.

Always ensure your Git environment is correctly set up and that you have the necessary access rights to the repository you're attempting to clone.

For more information on git clone see the official documentation.

Stay unblocked. Ship faster.
Experience the new developer workflow - create, review, and merge code continuously. Get started with one command.
Get started

Give your PR workflow
an upgrade today

Stack easier | Ship smaller | Review quicker

Or install our CLI.
Product Screenshot 1
Product Screenshot 2