Bitbucket password to clone a repo

·2 min. read·

Let's assume you already have a repository on Bitbucket, and you need to clone it locally. In the Bitbucket repository interface, there is a "Clone" button that opens a dialog with the option to choose the cloning method (HTTPS or SSH):

Repository page - Bitbucket
Repository page - Bitbucket
Clone dialog - Bitbucket
Clone dialog - Bitbucket

Typically, to avoid dealing with SSH keys, you can try copying the HTTPS repository link and then execute the git clone command:

git clone https://[email protected]/geekrainian-workspace/test.git

As a result of executing the command, Bitbucket will prompt for a password:

Password window while cloning a repository
Password window while cloning a repository

But what password is it asking for, and why doesn't the account password work?

fatal: Invalid credentials

The first thing to understand is that it's not the account password.

Bitbucket uses a separate access management system called "App passwords", where you need to create an access password to use it when working with repositories.

To create an access password, follow these steps:

  1. Click on the gear icon to open the settings, then select "Personal Bitbucket Settings".
Settings menu - Bitbucket
Settings menu - Bitbucket
  1. On the settings page, go to the "App passwords" section.

  2. Click on the "Create app password" button to generate a new access password.

  3. Set the access permissions as desired and click the "Create" button.

  4. A dialog will appear with the generated password.

App Passwords page - Bitbucket
App Passwords page - Bitbucket

Now, if we try to clone the repository again, after entering the password, the operation will complete successfully:

git clone https://[email protected]/geekrainian-workspace/test.git
Cloning into 'test'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), 964 bytes | 68.00 KiB/s, done.

Good to know:

  • Passwords do not have an expiration date and they will remain valid until you revoke them in the Bitbucket settings.
  • The password is cached in the system, so you don't need to enter it every time you need to perform an action on the repository.

You may also like

How to enable HTTPS on localhost for Node.js
Sometimes, you may need to secure your localhost to test certain things, such... Read more
·2 min. read
Giran Castle Town paper model
Found it on the internet. Author unknown... Read more
·1 min. read
Yarn vs NPM install speed comparison
Comparing the installation speed of Yarn and NPM packages across several... Read more
·2 min. read

© geekrainian.com