user2955724 user2955724 - 1 year ago 204
Git Question

How to manipulate Bitbucket repository with token?

I followed this documentation to get a token value and a token secret from bitbucket:

After that I want to push/pull to a given repo by using that token.

At Github I can use the token like this way:

My question is how can I use this kind of http authorization at bitbucket (mercurial/git)?

Answer Source

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}

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download