Skip to content

Instantly share code, notes, and snippets.

@oiotoxt
Created August 20, 2021 13:12
Show Gist options
  • Select an option

  • Save oiotoxt/ad726007a79dbfe770cbc17c4b244806 to your computer and use it in GitHub Desktop.

Select an option

Save oiotoxt/ad726007a79dbfe770cbc17c4b244806 to your computer and use it in GitHub Desktop.
GitHub Personal Access Token + Git Credential Manager Core
# GitHub Personal Access Token + Git Credential Manager Core (2021-08-20)
# <Git Credential Manager Core>
# install (Ubuntu 18.04)
# https://github.com/microsoft/Git-Credential-Manager-Core
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/ubuntu/18.04/prod
sudo apt-get update
sudo apt-get install gcmcore
git-credential-manager-core configure
# configuration
# https://github.com/microsoft/Git-Credential-Manager-Core/blob/main/docs/linuxcredstores.md#3-gits-built-in-credential-cache
git config --global credential.credentialStore cache
git config --global credential.cacheOptions "--timeout 30000000" # 1 year == 31,536,000 sec
# test
git pull
Select an authentication method for 'https://github.com/':
1. Web browser (default)
2. Personal access token
option (enter for default): 2
Enter GitHub personal access token for 'https://github.com/'...
Token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Already up to date.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment