Reputation: 5878
I am trying to use gitflow with bitbucket and sourcetree, could anybody tell me what is the best? to keep the develop and releases branches/tags always separated of the master or always merge it?
I wanted to have them separated, but when I make a push on bitbucket's branch section there is only a master and at the merged sections are the others, what is the best way to do it? and how can I use the best way of gitflow using sourcetree?
Thanks.
EDIT.
Here are the screenshots.
Locally is like this
and at bitbucket is like this: (theactive shows only master and develop is only at merged)
Is this correct? I really dont know when I should see the merged branches and where I should not.
Upvotes: 0
Views: 1075
Reputation: 137088
A branch is considered "merged into master
" if its head is reachable from master
.
Reachable means that if you start from master
and follow each commit backwards through its ancestry at some point you find the commit you're looking for.
For example:
G [master]
/
A---B---C---D [branch-a]
\
E---F [branch-b]
Here, branch-a
is reachable from master
. Start at master
's head (commit G
) and go backwards to D
, which is the head of branch-a
.
In contrast, branch-b
is not reachable from master
. If you trace backwards from master
you get G
, D
, C
, B
, A
. branch-b
's head (commit F
) is not found.
Since you currently only have one commit with both develop
and master
pointing at it, develop
is necessarily reachable from master
and is therefore "merged".
Once you start adding commits to develop
that aren't yet in master
, develop
will no longer show up as "merged".
Edit:
Here is a common scenario with Git Flow. This is simplified; I'm not showing feature or release branches.
A [master]
\
B---C---D [develop]
Here you're working on develop
, which contains three commits B
, C
and D
which are unreachable from master
. develop
is not merged.
Now you decide to do a release, resulting in something like
A-----------E [master]
\ /
B---C---D [develop]
develop
is now merged into master
, since we can reach develop
(at commit D
) from master
(at commit E
).
Now you start working again...
A-----------E [master]
\ /
B---C---D---F [develop]
...and develop
is no longer merged.
Upvotes: 3