I want to have rebase on top of staging (or merge with staging) before I deploy to my QA server so it will contain the latest changes + changes from my branch.
As a first step I tried to checkout staging and failed: I have the following configuration in bitbucket-pipelines.yml
merge:
- step:
name: merge with staging
image: node:8
script:
- git remote update
- git fetch origin
- git branch -f staging origin/staging
- git checkout staging
error:
+ git branch -f staging origin/staging
fatal: Not a valid object name: 'origin/staging'.
I did try a lot of other variants that are work locally but everything fails... looks like bitbucket limits access to other branches..
What is the correct way of checking out branches in bitbucket pipelines?
Before the fetch command, you need to configure it with this:
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With