CombustibleToast
CombustibleToast

Reputation: 199

Github git pull asking for credentials. Trying to use the personal access token it keeps bugging me about, can't figure out how

I have a bot hosted on another computer. I have cloned the repo onto the second computer and whenever I want to update the files in it, I do a git pull.
At this point, it asks for my credentials (username and password).

However, recently Github has been sending me emails saying that this method is becoming deprecated and tells me to use a personal access token instead.

I've generated one but can't figure out where to put it or how to use it.
It seems to work in place of my password, but is there a way to make it stop asking for my credentials?

Upvotes: 1

Views: 1548

Answers (1)

VonC
VonC

Reputation: 1324447

It seems to work in place of my password, but is there a way to make it stop asking for my credentials?

If you are using the latest Git, you can use:

git config --global credential.helper manager-core
printf "protocol=https\nhost=github.com\nusername=<me>\npassword=<my_token>" |\
  git-credential-manager-core store

Then, Git won't ask for your credentials anymore.

On Linux/Mac, you might have to install GCM (Git-Credential-Manager-Core) first.
On Linux, add:

sudo apt-get install libsecret-1-0
git config --global credential.credentialStore secretservice

Upvotes: 2

Related Questions