Clone private repo

HI all,

How can I clone a private repo?



Hi @jurajbgh, there are two main ways to accompilsh this, the first is authenticating with SSH - you can read GitHub’s articles to help you with setting this up, however, it’s more advanced.

The second way is using HTTPS and providing your username and password in the URL. For example if I was cloning a public repository I might use:

git clone

but if the repository was private then I’d use:

git clone

Please note if you use 2FA to secure your GitHub account then you’ll need to use a personal access token instead of your password, this article explains how to.


Thanks, Problem fixed.


Hi, might be possible that authentication fails when using HTTPS and providing your username and password in the URL in case the password contains special chars (case example:  p@ssword )? 


If you have a special character in your password, replace it with values from this website case example: p@ssword --> p%40ssword


I got this message: fatal: protocol ‘git clone https’ is not supported.  Not sure why…

1 Like

For anyone else reading, know that using the

git clone

way of doing things will cause your password to be written into the repo you just cloned in several different places, most notably the remote url.  Do not do this if you are planning to share access to your clone with anyone!


Great, it worked for me