Skip to content

Instantly share code, notes, and snippets.

@magickatt
Created September 6, 2019 17:31
Show Gist options
  • Star 47 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • 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}
@aabodzhran
Copy link

ا

@kashiftufail
Copy link

not working now

@jordanholtz
Copy link

it works for me

@Artalus
Copy link

Artalus commented Oct 4, 2023

Can also clone without username, by using token in its place with empty "password":

git clone https://${GITHUB_TOKEN}:@github.com/${GITHUB_REPOSITORY}

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