We use Bitbucket server at our company.
Today it happened that a multi-merge pull request (branch->stable->master, as we have a production branch set) failed on the stable->master part because of conflicts.
Nothing to worry. Bitbucket opens another pull request automatically to merge missing changes from stable to master branch.
The problem is that since I have set branch permissions to allow modifications to master branch only via pull requests I am unable to follow Bitbucket's instructions for manual merge
Bitbucket asks me to do the following:
Automatic merge failed because
there were conflicts. You must resolve the conflicts by merging
downstream only i.e. merging the source branch into the target branch.
Step 1: Fetch the changes (saving the source branch as FETCH_HEAD).
git fetch origin stable
Step 2: Checkout the target branch and merge in the changes from the source branch. Resolve conflicts.
git checkout master
git merge FETCH_HEAD
Step 3: After the merge conflicts are resolved, stage the changes accordingly, commit the changes and push.
git commit
git push origin HEAD
Step 4: The pull request will be updated and marked as merged.
Ok, but when I try to push the changes to master branch I get a fancy error message:
remote: *%%%%%.
remote: %%% %%%
remote: ,%# %%
remote: %% %%
remote: %# %%
remote: %% %
remote: %( %%
remote: %%%%%%%%%%%%%%%%%%%%%%%%%%%
remote: %#%*%#///////%# %%///////%%%%%%
remote: ,% %*%%******%# %%******%(%%,%
remote: %%/ %%/**%%/%%%%%%%(**#%( %%#
remote: %% %%% %(
remote: % .%
remote: *% %%%%% .%
remote: %# %%
remote: .%% .%%
remote: .%%.%%, %%%.%%/
remote: %%%%%%##%. #%%%%%. .%((%%%%%%
remote: %%#(((((((((%%, #%%(((((((((#%%.
remote: %%%((((((((((((((((((%%%, .%%%((((((((((((((((((#%%*
remote: %%(((((((((((((((((((((((((%(((((((((((((((((((((((((#%.
remote: ,%(((((((((((((((((((((((((((((((((((((((((((((((((((((((%#
remote: %#((((((((((((((((((((((((((((((((((((((((((((((((((((((((%
remote: %%%%%%%%%%%%%(((((((((((((((((((((((((((((((((%%%%%%%%%%%%%
remote: %% %####((((((###%%%%%%%%#(((((((((% ,%
remote: ,% %%%%%%#. %%%((((((%* %%
remote: #% %%%# %%
remote: .% .%%%%%%%%% %#
remote: % #%%% %
remote: % %%%% %*
remote: /%************/#%%%%%%######%%* ..,*/(%%
remote: %%######(((((((##################%%
remote: %%######(((((((((((((((((((((((((%%
remote: //////////////%%%%%%%%#########################%%///////// ///
remote: ----------------------------------------------------
remote: Branch refs/heads/master can only be modified through pull requests.
remote: Check your branch permissions configuration with the project administrator.
remote: ----------------------------------------------------
remote:
I am forced to push to another (temporary) branch from which to open a pull request.
Shouldn't Bitbucket server implement a check that allows direct pushing to a protected branch (with respect to other permissions, e.g. only me and few coworkers can modify the master branch) if that push merges an open pull request?
Or am I doing something wrong?