How to manipulate Bitbucket repository with token?
I used an App password which I created from the Bitbucket Cpanel under Settings -> Access management (sidebar) -> App Passwords. After I did this I cloned the repo by using my username and the new app password as follows:
https://[your_user_name]:[app_password]@bitbucket.org/[your_user_name]/[repo_name].git
This BitBucket page mentions:
We recently introduced OAuth 2 and also added the ability to use them as HTTP Basic Auth credentials.
Cloning a repository with an access token
Since add-ons will not be able to upload their own SSH keys to clone with, access tokens can be used as Basic HTTP Auth credentials to clone securely over HTTPS.
git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git
The literal string
x-token-auth
as a substitute for username is required.Our process is similar to GitHub, yet slightly different: the difference is GitHub puts the actual token in the username field.
See more at "OAuth on Bitbucket Cloud", as suggested in the comments by nick graziano.