I'm setting up a CI pipeline on a BitBucket Repository based around docker. I'm running build commands then up then test, basically. This all works so far, but the issue I'm having is BitBucket **only** commits or lets me edit changes to the *bitbucket-pipelines.yaml* file on the master branch.

I'm not the only developer on the project, and right now our master is our staging/ready for prod branch, and we've all agreed to use other branches for things and let one of us manage master and merges into it.

My question is, can I use another, different branch than master to "manage" my pipelines file on, like our active development branch? For some reason, I can't find a way to add a pipeline to another branch, and pushing up a bitbucket-pipelines.yaml file on the develop branch won't trigger a build.

For reference, my pipeline yaml:

```
image: atlassian/default-image:2

pipelines:
  # pull-requests:
  #   'feature/*':
  #     - step:
  #       services:
  #         - docker
  branches:
    develop:
      # each step starts a new Docker container with a clone of your repository
      - step:
        services:
          - docker
        script:
          - (cd app/laravel/ ; npm install)
          - (cd app/laravel/ ; npm run production)
          - docker build -t myApp -f app/Dockerfile app/
          - docker stack up -c docker/docker-compose.yaml myApp

```
['https://Stackoverflow.com/questions/62160195', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3069555/']
You should be able to have a pipeline in any branch you want.  

From the [troubleshooting section](https://confluence.atlassian.com/bitbucket/troubleshooting-bitbucket-pipelines-792298903.html#TroubleshootingBitbucketPipelines-Mybranchdoesn%27tbuild):

> 
> My branch doesn't build
> -----------------------
> 
> 
> Make sure that there is a `bitbucket-pipelines.yml` file in the root of your branch.
> 
> 
> To build a branch, you must specify a `default` or a `branch-specific` pipeline configuration.  
> 
> For more information, see [Configure bitbucket-pipelines.yml](https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-pipelines_branch_definition).
> 
> 
> 

I would test that, following [branch workflow](https://confluence.atlassian.com/bitbucket/branch-workflows-856697482.html), with a simplified yaml first (one which does just an echo for a given branch), for testing.

As the [OP RoboBear](https://stackoverflow.com/users/3069555/robobear) confirms [in the comments](https://stackoverflow.com/questions/62160195/avoid-using-master-branch-for-bitbucket-pipeline/62166436?noredirect=1#comment109951501_62166436), the `bitbucket-pipelines.yml` must use the `.yml` extension, *not* `.yaml`.
My problem was that pipelines had not been enabled for the repo and since I added the bitbucket-pipelines.yml file to a branch that was not the main branch, and not using the onboarding tutorial, pipelines had not been enabled for the repository. Go to Repository settings -> Pipelines | Settings -> Enable Pipelines. Then you will have to push another change to the branch with the bitbucket-pipelines.yml and it should run the pipeline.