I'm using GitFlow to develop an app. Every task has a feature/* branch and quick fixes have bugfix/* branches. Everything is merged to develop. No issues so far. Once every couple of weeks or so (let's say at the end of every sprint) I (and only I, other team members don't have access to merge) merge develop branch into staging branch. There is a pipeline for staging branch (the only branch with pipeline so far) running after every PR that updates staging server with latest changes from last sprint. Both develop and staging are blocked, you can't commit to those branches, you need to create a PR.
Few days ago I merged PR 132 (bugfix) into develop and then created PR 133 to merge develop into staging. Something was wrong with pipeline script, it couldn't rebuild Docker images on the server and failed after a long time. I created another bugfix and merged it in PR 134 into develop and then created PR 135 to merge develop into staging. This time pipeline didn't start because previous run exhausted all available minutes. Fair enough, didn't pay too much attention as I didn't need staging server updated at the time.
Today I finished working on a feature branch and merged PR 136 into develop. When I tried to merge develop into staging, it says staging is 3 commits behind and it needs to merge PR's 132, 134 (both should be part of staging branch) and 136 and it can't because there are conflicts. When I tried to do it the other way, it says develop is 2 commits behind staging and PR's 133 and 135 need to be merged (and there are conflicts). But PR's 133 and 135 were develop merge into staging...
At this point I'm completely lost. I can't do anything since staging can be updated by PR only and those supposed conflicts are Bitbucket trying to merge again what is already merged. I had such problem once in my life and couldn't figure out what and why (but there was a failed pipeline run before problems started so that might be a problem) and I ended up deleting and recreating staging branch with took quite a lot of time (since we are using staging branch on shared server) plus it costs me entire merge history (we are using squash). I would like to avoid that if possible.
You can try the following:
Hope that helps
I was kind of hoping that some would explain why and how it happened but thank you for providing steps to fix it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.