Skip to content

Instantly share code, notes, and snippets.

@magickatt
Created September 6, 2019 17:31
Show Gist options
  • Save magickatt/07ff02068f8cd2e4e558f20358b2082c to your computer and use it in GitHub Desktop.
Save magickatt/07ff02068f8cd2e4e558f20358b2082c to your computer and use it in GitHub Desktop.
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
@S-Stephen
Copy link

I get: "remote: Support for password authentication was removed on August 13, 2021." Though only on more recent repos...

This is confusing. I could use an ssh key but that would provide access to all features. At least the PATs provided fine grained scopes....

Any idea what is going on?

@jonesy-b-dev
Copy link

Having struggles with it too, clone with a PAT and then it asked me for my password and then its saying that Support for password authentication was removed on August 13, 2021

How do I access my repos now?

@S-Stephen
Copy link

I get: "remote: Support for password authentication was removed on August 13, 2021." Though only on more recent repos...

This is confusing. I could use an ssh key but that would provide access to all features. At least the PATs provided fine grained scopes....

Any idea what is going on?

Figured out that PAT can not be used on others' private repos that you have access to.

"Each token can only access resources owned by a single user or organization."

The method works with the classical Token but this doesn't restrict access enough...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment