How Do You Troubleshoot “permission denied” when Trying to Clone a Git Repository That You Should Have Access to?

Problem scenario
You configured the source repository (in GitHub, GitLab, in BitBucket or elsewhere) to allow your user to have permissions to read the repository.  You run git clone but you get a "permission denied" error.  What should you do?  

Possible solutions
The Linux server you are on may not give your Linux user permissions to write to the destination directory.  Can you clone the repository to the /tmp/ directory?  This should help you isolate the problem if it works.  See if other users can clone the repository to other servers.  Does the repository path (e.g., ssh:// or http://) have problems in it?  Could a character or two be incorrect and happen to match another repository accidentally?

Leave a comment

Your email address will not be published.