Git Clone from Linux command line not working
Asked by Reuben Remy:

I get following error whenever I try to clone a repo that my new team is working in FYI; i've changed the https link for privacy reasons.:

```
Cloning into 'dashboard'...
Missing or invalid credentials.
Error: socket hang up
at connResetException (internal/errors.js:570:14)
at Socket.socketOnEnd (_http_client.js:440:23)
at Socket.emit (events.js:228:7)
at endReadableNT (_stream_readable.js:1185:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21) {
code: 'ECONNRESET'
}
remote: Invalid username or password
fatal: Authentication failed for 'https://bitbucket.org/myRepo/testRepo.git/?
```

I've been working at it all morning. This is my first time using bitbucket as I normally use github.

Please Advise!


Answers:
author: Theodora Boudale
body: Hi Reuben,

Is this a private or a public repo?

I see that the HTTPS URL in the output doesn't include your Bitbucket username. Is this because you removed it for privacy reasons, or was it not included in the URL?

If it was not included in the URL, can you try cloning with a command like the following

```
git clone https://username@bitbucket.org/myRepo/testRepo.git
```

where *username* replace with your own Bitbucket username which you can find here <https://bitbucket.org/account/settings/> after you log in to Bitbucket.

When you execute this command, could you also please let me know if you get asked for a password (that you enter manually) or not?

Kind regards,  
Theodora

comments: author: Reuben Remy
body: Hi Theodora - Yes I id remove the username for privacy reasons but yes when I executed the command it asked for a password but my account was google authenticated.


author: Theodora Boudale
body: Hi Reuben,

Thanks for the reply.

If you open <https://id.atlassian.com/login> from an Incognito/Private window on your browser, enter the email of your Bitbucket account there and select **Continue**, do you get redirected to Google login? Or do you see a field to enter a password?

++If you get redirected to Google login++ after pressing **Continue**, this means that the account is managed. In this case, you need to use an app password instead of the account's password, when you clone/pull/push via HTTPS.

You can check the following documentation on how to generate an app-password and you can use that when you are asked for a password from command line.

* <https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/>

++If you see a field to enter a password after selecting **Continue**++ , this means that the account is not managed. In this case, you can request a password reset email via <https://id.atlassian.com/login/resetpassword> and use the new password you will set.

The Google password won't work here, it needs to be the password of the Atlassian account. An app-password can be used as well.

Please feel free to let me know how it goes and if you need further help.

Kind regards,  
Theodora


author: Reuben Remy
body: Thank you Theodora! creating the App password did the trick! ?


author: Adrian Delgado
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) ,I have the same problem with git bash on linux

Clonando en 'repo'...  
Password for '<https://username@bitbucket.org>':   
remote: Invalid credentials  
fatal: Autenticaci?n fall? para '<https://bitbucket.org/repo.git/>'  

<br />

but in my case, if I used my password correctly, I verified it by entering the page: <https://bitbucket.org/company>, the password worked, but when I tried to clone the repo I got invalid credentials  


author: Theodora Boudale
body: Hi [@Adrian Delgado](/t5/user/viewprofilepage/user-id/5453739) ,

We have deprecated the use of account passwords for Git over HTTPS and API.

You will need to generate an app password and use that instead of a password when cloning, pulling, or pushing via HTTPS:

* <https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/>

Kind regards,  
Theodora


Tags: atl-gruland

bitbucket-cloud

cloud