Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to use bash & git clone -c http.extraHeader='Authorization Bearer...'

Michelle Anduaga-Arias
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 11, 2023

Hello!

In Bitbucket I created a read only Authorization Bearer token.
When I use the command below in a bash script, I am prompted for my name and password.  I need to backup the repositories NOT using my credentials but a "group" credential. It is my understanding that this command *should* work to authenticate without having to enter my personal information.

git clone -c http.extraHeader='Authorization: Bearer ...foobar bubble babble...' --mirror https:bitbucketserver.com/scm/projectname/teamspace.git

How can I authenticate without needing to enter my credentials.

All suggestions welcome!

Michelle

1 answer

0 votes
nthomas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2024

Here is a similar question with some relevant answers: https://community.atlassian.com/t5/Bitbucket-questions/How-do-you-clone-a-repository-from-Bit-Bucket-server-using-a/qaq-p/751179

Personally I couldn't get the -c extraHeader method to work, so I ended up using a method similar to this:

git clone https://{username}:{access_token}@yourbitbucket.org/user/repo.git

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events