I have a question that I feel like would be a common issue for many people. However, I'm unable to find any answer to my question.
I have a bitbucket repository that is using the git flow workflow (not using git-flow). However, I'm currently experiencing some workflow issues when using branch permissions. I have the following branch naming convention:
master
develop
hotfix/...
release/...
feature/...
I have configured my repository with write access, on branches master
and develop
, only through pull requests. For all other branches full permission is given, i.e. anyone can push code to them.
The problem I have can be explained by the following sequence of actions.
origin/master
and origin/develop
.feature
branches is created and merged into origin/develop
through pull requests.origin/master
). hotfix
branch is created from master
, let's call it hotfix/some-hotfix
.The bug is fixed and hotfix/some-hotfix
branch is pushed to the repository. We now also have a remote branch origin/hotfix/some-hotfix
. At this stage we have:
origin/develop
is a head of origin/master
by a number of commits (depends on how development has progressed).origin/hotfix/some-hotfix
is a head of master (by the commits made to fix the bug).A pull request is created to merge origin/hotfix/some-hotfix
into origin/master
. This will work fine, since origin/hotfix/some-hotfix
is created from origin/master
.
Note: The pull request is not necessarily resolved, i.e. origin/hotfix/some-hotfix
is not merged into origin/master
.
origin/hotfix/some-hotfix
into origin/develop
. This will, in many cases, results in conflicts; changes have been made to both branches.I can't merge origin/develop
into origin/hotfix/some-hotfix
, since this branch is intended to me merged into origin/master
. Any changes pushed to the hotfix branch, before a finalised pull request to master, will also end up in master. Changes made to develop might break master.
One solution is that, I can be very careful and make sure that any pull requests to master is completed before starting to process the pull requests to develop. In my opinion, this is not ideal. This is both risky (what if I forget) and hinders further development (no one can start to go through the pull request from hotfix to develop before master is done):
I feel like this would be a common problem with this workflow.
Based on the above
Thanks in advance
答案 0 :(得分:0)
不,你没有以错误的方式解释工作流程。
我认为我们可以让这个hotfix/some-hotfix
分支在master中合并。之后,我们可以将主分支合并到origin/develop
以获取master
分支的最新代码,或者我们可以使用origin/develop
重新定义master
分支。我认为合并更好。合并/重新定位develop
master
分支中的冲突