The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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
TAGS
AUG Leaders

Atlassian Community Events