gitgithubgit-credential-managergithub-token

How can I store Github token with Git Credential Manager on Ubuntu?


With the new Git Credential Manager (GCM) how can I use it to store Github access token on Ubuntu? I have tried to read the usage text and it is not clear how one can store Github token using it.


Solution

  • You can store it with:

    printf "host=github.com\nprotocol=https\nusername=you\npassword=yourToken" | \ 
      git credential-manager-core store
    

    Make sure git-credential-manager is in your $PATH.
    Replace 'you' with your GitHub account name, and 'yourToken' by your GitHub token.