There are a few common errors with 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: The requested URL returned error: 401 while accessing # https://github.com/user/repo.git/info/refs?service=git-receive-pack # fatal: HTTP request failed
# Error: The requested URL returned error: 403 while accessing # https://github.com/user/repo.git/info/refs # fatal: HTTP request failed
# Error: https://github.com/user/repo.git/info/refs not found: did you run git # update-server-info on the server?
Make sure you have git 1.7.10 or later. You can download the latest version here
git --version # git version 22.214.171.124
The remote repository must exist on GitHub, and the URL is case-sensitive.
git remote -v # View existing remotes # origin https://github.com/github/reactivecocoa.git (fetch) # origin https://github.com/github/reactivecocoa.git (push) git remote set-url origin https://github.com/github/ReactiveCocoa.git # Change the 'origin' remote's URL git remote -v # Verify new remote URL # origin https://github.com/github/ReactiveCocoa.git (fetch) # origin https://github.com/github/ReactiveCocoa.git (push)
If you have enabled two-factor authentication, you must provide a personal access token instead of entering your password for HTTPS Git. You can create a personal access token for accessing GitHub by going to the application settings page.
When prompted for a username and password, make sure you use an account that has access to the repository.
Tip: If you don't want to enter your username and password every time you interact with the remote repository, you can turn on password caching.
If you've previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see this guide.