This is an example of how to authenticate to GitHub.com using Git Credential Manager on Linux.
At this moment, you'll first need to authenticate to read publicly available packages. See Authenticating to the Container registry for more information.
echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin
docker pull ghcr.io/lowply/gcm-linux:latest
docker run -it --rm ghcr.io/lowply/gcm-linux:latest
Now try git clone
your private repository in the container. You'll be asked to authenticate based on the auth mode you choose.
You'll be asked to choose the AuthMode in the initial clone. Here are the examples:
root@50d697802a25:/home# git clone https://github.com/owner/repo.git
Cloning into 'repo'...
Select an authentication method for 'https://github.com/':
1. Device code (default)
2. Personal access token
option (enter for default):
To complete authentication please visit https://github.com/login/device and enter the following code:
XXXX-XXXX
You'll find the Git Credential Manager oauth app at https://github.com/settings/applications
root@bc9ae762dac9:/home# git clone https://github.com/owner/repo.git
Cloning into 'repo'...
Select an authentication method for 'https://github.com/':
1. Device code (default)
2. Personal access token
option (enter for default): 2
Enter GitHub personal access token for 'https://github.com/'...
Token:
Because the purpose of this repository is to demonstrate how to get started with Git Credential Manager on a Linux system, plaintext
is selected as the credential store. Do not do the same on your production environment. Please read Credential stores for more information.
make build