Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Using Bitbucket Pipelines to Sync Git Repos with Password-based Access

Is there a way to use Bitbucket Pipes to sync a Bitbucket repo with an external git repo that only allows authentication with userid/password?  I can only find examples of doing this with key-based authentication. 

Presently Adobe Experience Cloud solutions host code in a git repo that they control, which only allows userid/password auth and not key-based auth. 

1 answer

1 vote

Hi @Tad Reeves  and welcome the community.

You can do this the following way:

1. Create variables for the username and password, either as repository variables (from the Repository settings page > Repository variables) or as workspace variables (from workspace Settings > Workspace variables), if you need those in more than one repo.

Make sure that you select the checkbox Secured when you create the variable for the password, so that it's not visible to anyone.

2. In your bitbucket-pipelines.yml file, you can include in the script a command that pushes to the repo:

git push https://${username}:${password}@hosting-provider/repo-owner/repo-name.git

 assuming that the variables were named username and password

Replace also the values for hosting-provider/repo-owner/repo-name with the appropriate ones for your repo.

The Docker image that you use for the step that does the push should have git installed already for this to work.

Is this something that works for you? Please feel free to let me know if you have any questions.

Kind regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

209 views 2 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you