Bitbucket Git Clone with MFA Enabled
In this post, we will go through the stpes that you can follow to clone a Bitbucket git repository to your local machine when multi factor authentication (MFA) is enabled on your Bitbucket account.
Since we have MFA enabled on the Bitbucket account, we cannot clone the git repository directly. Instead, we can use tokens to authenticate git operations to the respository.
- Login into your bitbucket repository.
- Navigate to Profile -> Manage Account -> HTTP Access Tokens.
- Create a tocket with appropiate name and selected the required permissions which will be associated with the token.
- Once the tocken is generated, please save it in a secure place as it is visible only once.
- On your machine, type the below command and enter the tocken as your password:
1 2 3
git clone <repository_rule> Username for <repository_url> : Password for <username>:
- The git repository should be cloned to your machine in the current directory.
This post is licensed under CC BY 4.0 by the author.