Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Cloning private repo with a Github App private key

Solved! Go to Solution.



I was wondering if it is possible to clone a private repository using a Github App private key.


Is it possible?

If so, do you know which permissions it requires to do so?


I tried giving it "Contents" read-only permissions, but it still cannot clone it...


The way I test it is by using:

ssh-agent bash -c 'ssh-add {{private_key_file.pem}}; git clone{{username}}/{{repo}}.git'
1 Reply
Ground Controller Lvl 1
Message 2 of 2

Re: Cloning private repo with a Github App private key

Did you find a solution?


I am trying to clone private repositories with my Github App aswell.


I just found a way that works for me using the command line. at the very bottom


git clone https://x-access-token:<token>


I am retrieving a user token using a POST request to$installationId/access_tokens.