Cloning a repo as a github app installation

I’m trying to clone a private repository as a private Github App that has been installed on an organization that the private repo is in. My app has been granted access to that repo, with the contents permission set to write

I followed the instructions here:

Installations with permissions on contents of a repository, can use their installation access tokens to authenticate for Git access. Use the installation access token as the HTTP password:

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

However, when I tried this, I get the following error:

fatal: unable to look up x-access-token:<accesstoken> (port 9418) (nodename nor servname provided, or not known)

Any ideas what I’m doing wrong here? Do I need to specify a different username than “x-access-token”?


1 Like

Usually the trailing .git in repository URLs is a main source of problems with Git operations over HTTP. Try removing the trailing .git from your remotes, scripts, etc., and see if this solves the problem.

The command you use works for me. Maybe you did not set the github app permissions correctly?