When I attempt
git clone https://<our repository>.git --progress
I get the error
fatal: Authentication failed for 'https://<our repository>.git'.
My first attempts were in a Docker container running Linux on a windows machine.
- First, I tried authenticating by putting my credentials into the url, like so:
git clone https://<username - the email I use for Bitbucket>:<my personal access token>@<url of our repository>.git
I have two PATs. One is read-only and one has read and write privileges. Neither worked.
- Then (still in the Linux Docker container) I ran the command
git config --global credential.helper store
hoping that it would find the credentials (username: email i use with Bitbucket/ password: read-write PAT) that I have stored locally on Windows. Then I ran
git clone https://<our repository>.git --progress
after nearly 20 minutes it returned
fatal: Authentication failed for 'https://<our repo>.git
- Next I created a file called .git-credentials in the directory I was trying to clone into. The file contained just the line:
'https://<email>:<PAT>@<repo url>.git'
(I tried it with an '@' in the email and also with '%40' in place of the '@'. ) I then ran the commands
git config --global credential.helper "store --file .git-credentials" --add
git clone https://<our repository>.git --progress
This failed with the same error.
- I then decided to see whether I'd have better luck outside the Docker container. I installed Git for Windows and in the MINGW64 terminal I typed $ git config --global credential.helper manager-core
then
git clone https://<our repository>.git --progress
A form entitled The Windows Security Git Credential Manager appeared and asked for a username and password. Again I entered my email and PAT. Failure. Then I repeated these steps and entered the password I use to log into Bitbucket. That didn't work either.
If anyone here could suggest something else I might try, I would be deeply grateful.