Search code examples
bitbucketatlassian-sourcetreegit-flow

using sourcetree and gitflow to do a release


I am new to using sourcetree and my repository is in bitbucket.

If i am using the git-flow to do release do i need to have write permission on both master and develop because when i click the finish release button it creates changes to my local master and develop and i am not able to push these as i don't have write permission.

I can only make pull request. So i am not sure the sequence of events i need to do. I have tried to create pull request from release to master and also release to develop, approve and merge but then when i click finish release to add the tag i still get same issue.


Solution

  • There is no other way but by manually do the steps that a git flow release finish is doing:

    Here is the summary:

    1. Merge release branch to master branch.
    2. Delete the release branch.
    3. Tag the master branch with the right version.
    4. Merge the master branch to develop.

    Git-Flow is not strict whether you use the git flow release finish or not. It is intelligent enough to know that when a release branch is already merge to master and develop branch and that the release branch is already deleted, Git Flow automatically recognizes that the release branch is finished. Same goes with feature branches.

    Here is how you should do it:

    1. Create a pull request from release => master branch.
    2. Wait until the pull request is approved and completed.
    3. Once the pull request is completed make sure that the release branch is deleted.
    4. Tag the new master branch with the right release version.
    5. Then, create another pull request master => develop.
    6. Wait until the pull request is approved and completed.
    7. Then pull all changes.

    With these steps, you keep the pull request and the git-flow process at the same time.