I am trying to clone a bitbucket server repo (self-hosted) using access-token however I could not find any documentation on Bitbucket server API. My clone url is ssh based.
Or is there a way to use REST API curl command to clone bitbucket server repos?
The official documentation says that you should:
git clone https://x-token-auth:$ACCESS_TOKEN@yourbitbucketserver/...
In my experiments with a BitBucket 6.1 server, this does not work and gives HTTP 401 instead. Using ssh with access tokens seems to be entirely unsupported.
What did work was:
git -c "http.extraHeader=Authorization: Bearer $ACCESS_TOKEN" clone https://yourbitbucketserver/...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With