Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

When I try to clone a repository, authentication fails.

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 


          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

Another update:

I can also clone from Gitlab into the Docker container.


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. 


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
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,243 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you