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

Git commands on pipelines

I m trying to run some git commands on the pipeline, I tried two solutions none of them worked;


- generated an ssh key from the repository settings

- copied the public key into the authorized_keys file via this command. (this command is in the .yml file )

- cat >> ~/.ssh/authorized_keys


- git config $MY_GIT_USERNAME
- git config $MY_GIT_EMAIL

 Note: the repository is a bitbucket repos and is where the pipeline is running. So no external repos.

Also followed the steps here but it's not helping

Am I missing something ?

1 answer

When you configure an SSH key in your repository's Settings > Pipelines > SSH keys, you are presented with two options:

  • Generate keys
    This automatically generates a public and private SSH key pair. The private key can be used with SSH to access the Git repository on a read-only basis. This isn't very useful if you want to push to Git from a pipeline.
  • Use my own keys
    This allows you to provide SSH keys that have been granted access to your Git repo. It is possible to generate SSH keys that grant write access to the Git repo. See below for details

Obviously you want the Use my own keys option which grants read and write access. You can use team-level SSH keys so that CI scripts aren't tied to a specific user (although you'll get warnings about it).

Here's the process:

  • generate an SSH key pair on your local machine,
  • add the public key to the SSH keys in your Bitbucket team (Your team > Settings > Security > SSH keys),
  • add the same public key and the corresponding private key to Pipelines via Settings > Pipelines > SSH keys.

Here's hoping Bitbucket Pipelines will provide much easier git write access and hopefully before Bitbucket removes team-level SSH.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Team Playbook

Atlympic Event: Team Playbook

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

77 views 0 8
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