Cloning a repository from GitHub

You can clone a remote repository to your local machine. If you run into errors, there are some common troubleshooting solutions.

  • Cloning a repository

    When you create a repository on GitHub, it exists as a remote repository. You can clone your repository to create a local copy on your computer and sync between the two locations.

  • HTTPS cloning errors

    There are a few common errors when using HTTPS with Git. These errors usually indicate you have an old version of Git, or you don't have access to the repository.

  • Error: Repository not found

    If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it. There are a few solutions to this error, depending on the cause.

  • Error: Remote HEAD refers to nonexistent ref, unable to checkout

    This error occurs if the default branch of a repository has been deleted on GitHub.

Did this doc help you?Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

Or, learn how to contribute.