334

I have an account on bitbucket.org that I created by signing up with my Google account. Now everytime I log in I just click "Log in with Google" and that's fine.

How can I access my repos from git command line? It requests me username and password. I have a username, but no password. How do I log in then?

Alex
  • 5,465
  • 5
  • 15
  • 33
  • 12
    March 2019 and this is still an obscure and undocumented process... I have never heard of an application where the login credentials to the site are different between the website and the command line interface. The explanation as to why this is necessary should be much more prominent. – Oscar Bravo Mar 23 '19 at 08:40
  • 1
    My first time using bitbucket and I still face this same issue, In fact i now have two accounts with the same email account@gmail.com is different from account@googlemail.com, even a beginner website syncs account@gmail.com and account@googlemail.com to a single account. – Peter Moses Apr 22 '19 at 10:12

9 Answers9

392

You should do a one-time setup of creating an "App password" in Bitbucket web UI with permissions to at least read your repositories and then use it in the command line.

How-to:

  1. Login to Bitbucket
  2. Click on your profile image on the right (now on the bottom left)
  3. Choose Bitbucket settings (now Personal settings)
  4. Under Access management section look for the App passwords option (https://bitbucket.org/account/settings/app-passwords/)
  5. Create an app password with permissions at least to Read under Repositories section. A password will be generated for you. Remember to save it, it will be shown only once!
  6. The username will be your Google username.
blahdiblah
  • 30,909
  • 18
  • 92
  • 149
ctrl-z
  • 4,049
  • 2
  • 6
  • 4
  • 16
    They should so much simply create the a password after the first connection using the SSO...Thanks a lot, this step was really unclear. Now the screen is [Click you avatar bottom left] > [settings] > [App Password] > [Create App Password] > Select many options (Follow your desire) and voila. Note that the username is the one selected after the first connection using the Google SSO. – Nordes May 31 '18 at 14:25
  • What to use as "label" and what to use as "username" in this case? – Dims Dec 11 '18 at 18:57
  • 2
    Sorry, It will not be the google account username. It will be the BitBucket username which is chosen by a user at the time of account creation. Anyway, your answer helped except the mentioned problem. – Md. Sabbir Ahmed Apr 22 '19 at 07:51
  • 1
    username is found on the same page in the General > Account settings > Bitbucket Profile settings > section. – Prashant Saraswat Apr 22 '19 at 20:40
  • this is the correct answer ...now if you can tell me why set ssh key isn't working either! :) – mangonights Apr 25 '19 at 01:02
  • Not sure why so many person think this is correct answer? It doesn't work at all. Second, the auto-generated so-long passwod can't be remembered at all. Even you successful set it, it will be useless. The current accepted answer to use `forget my password` is the easy and fast way to set your nomiated password. – BMW Oct 15 '19 at 04:04
  • this worked for me but not with point 6 using my google username. i had to use my bitbucket username, which is found in the account settings section about half way down the page – rdans Mar 22 '21 at 12:16
  • Use your usernames in your account instead of your gmail as username guys, the rest works fine! thanks – Ziyad Mansy Apr 07 '21 at 17:33
152

Solved:

  • Went on the log-in screen and clicked forgot my password.
  • I entered my Google account email and I received a reset link.
  • As you enter there a new password you'll have bitbucket id and password to use.

Sample:

git clone https://<bitbucket_id>@bitbucket.org/<repo>
BMW
  • 34,279
  • 9
  • 81
  • 95
Alex
  • 5,465
  • 5
  • 15
  • 33
33

It's March 2019, and I just did it this way:

  1. Access https://id.atlassian.com/login/resetpassword
  2. Fill your email and click "Send recovery link"
  3. You will receive an email, and this is where people mess it up. Don't click the Log in to my account button, instead, you want to click the small link bellow that says Alternatively, you can reset your password for your Atlassian account.
  4. Set a password as you normally would

Now try to run git commands on terminal.

It might ask you to do a two-step verification the first time, just follow the steps and you're done!

Lucas Bustamante
  • 11,643
  • 6
  • 66
  • 74
  • 1
    Now you don't get the small link in the 3rd step because they have changed it. You get one login for all Atlassian products. Just type the new password and *Voila* – Damitha Raveendra May 17 '19 at 13:20
  • 2
    As of July 2019 this appears to be a working solution Kinda understand how the situation has evolved for the Atlassian company, but some UI hints and documentation are sorely missed. Apparently 'login with Google' is fine for folks only wanting to browse repos, but not so much for actual active developers. – Walter K Jul 12 '19 at 20:34
16

One way to skip this is by creating a specific app password variable.

  1. Settings
  2. App passwords
  3. Create app password

And you can use that generated password to access or to push commits from your terminal, when using a Google Account to sign in into Bitbucket.

Crisoforo Gaspar
  • 3,367
  • 2
  • 17
  • 26
  • Use the avatar bottom-left; not the google avator top-right. Then note that there is an extra step, 1a) App Marketplace. – Oscar Bravo Mar 23 '19 at 08:43
  • Which permissions did you choose? Is Repository Read/Write enough for git cli client? A `git push` worked for me with r/w only. – Jörg Gottschlich Jan 13 '20 at 06:19
  • I think this is the best/most modern solution in terms of security: dedicated, limited access credentials for daily work which can be revoked anytime from your bitbucket account, while keeping your bitbucket account passwordless. – Jörg Gottschlich Jan 13 '20 at 06:26
7

You can setup SSH key authorization like described here - https://confluence.atlassian.com/bitbucket/add-an-ssh-key-to-an-account-302811853.html.

vodolaz095
  • 5,502
  • 3
  • 21
  • 36
5

Update as at September, 2019:

This whole process is now way easier than it used to be. It doesn't matter if your auth style is regular or Google-dependent, it works regardless. Follow these four easy steps:

  • Visit this link and enter your email.
  • Check your mail for the reactivation email and click the big blue button therein.
  • Change your password!

I hope this helps. Merry coding!

Taslim Oseni
  • 4,610
  • 10
  • 34
  • 50
3

you don't have a bitbucket password because you log with google, but you can "reset" the password here https://bitbucket.org/account/password/reset/

you will receive an email to setup a new password and that's it.

Cristian Sepulveda
  • 1,198
  • 1
  • 13
  • 24
3

Follow these steps:

  1. login to bitbucket
  2. Click on Personal Settings
  3. Click on Create App Password, here give permission to read and write and the login to GitHub desktop using the same password. Note: Take a screenshot of the password as you won't retrieve it again.

steps updated as on 13th July 2020 Thank You: Rahul Daksh

2

You can attach a "proper" Bitbucket account password to your account. Go to https://id.atlassian.com/manage/change-password (sign in using your Google account) and then enter a new password in both the old and new password boxes. Now you can use your email address and this new password to access your account on the command line.

Note: App passwords are the official way of doing this (per @Christian Tingino's answer), but IMO they don't work very nicely. No way of changing the password, and they are big unwieldly things to type into the command line.

HughHughTeotl
  • 4,480
  • 2
  • 27
  • 41
  • 2
    I tried, but the Old/New Password fields were disabled. Even the mouse cursor changes to show you can't input anything in them... Then I closed the tab, reopened with Ctrl+T and the fields were enabled. However, it asked for the old password. Neither the new password nor my Google password worked. – GuiRitter Sep 04 '18 at 18:29