Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

When I try to clone a repository, authentication fails.

Daniel Mathers November 17, 2021

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.

 

2 answers

0 votes
Daniel Mathers November 17, 2021

Another update:

I can also clone from Gitlab into the Docker container.

0 votes
Daniel Mathers November 17, 2021

Update:

I tried cloning one of our repos hosted on Gitlab into the Windows environment. That worked with no issue. My authentication problem seems to be with Bitbucket. 

Daniel Mathers November 18, 2021

Update:

We've resolved this issue at our end.

Dear moderator: I think you should delete this question, as the problem was actually specific to the way our corporate network works. If someone happens across this post, and has the same problem I was having, their resolution will probably be different. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events