Git clone with PAT is failing

I’m trying to clone one of my private repositories on a new machine (linux subsystem on my windows machine). My git client is 2.25.1. My PAT works on my mac machine.

On my linux subsystem I run:

PROMPT> git clone
Cloning into 'dotfiles'...
Username for '': bkushigian
Password for '':
remote: Invalid username or password.
fatal: Authentication failed for ''

Now I can’t see what I’m pasting into the password field because it’s hidden, but I’ve tried pasting to terminal and it works. I’ve also tried a few other solutions, like using arguments

git -c http.extraheader="AUTHORIZATION: Basic $(echo "bkushigian:ghp_MY-PERSONAL-ACCESS-TOKEN"|base64)" clone


git clone

but I keep getting denied access.

Shouldn’t this ‘just work’? Are there special hoops I have to jump through?

Followup: I created a new PAT and it worked. Is this what I’m supposed to do? From what I read it seemed like PATs are supposed to be 1-per-user, and I’m the same user (same git config file, etc).

PATs should work regardless of which machine you’re on. I obviously can’t check, but my guess is that there was some issue with copying it, maybe an extra space or linebreak or something.

1 Like