Search code examples
gitgithubbitbucketgit-flow

`git flow release finish` does not merge code in `master` branch on remote repo


Initially I am cloning a Git repo to my local and then doing:

git flow init .

I am able to successfully create feature branch and merge to develop by creating pull request.

Now I use:

git flow release start <branch_name>

and push the release branch to remote.

Changes are fine so I do:

git flow release finish <branch_name> .

It executes fine on local and code is merged to develop and master branch, tag is cut and release branch is deleted, but on remote repo changes are not automatically merged to master branch but are back merged to develop branch only.

What is the possible issue it did not merge into master branch of remote repo?


Solution

  • In Git, changes are done locally and then must be pushed to the remote. This lets you do your work locally before deciding it is ready to share it with others.

    git flow release finish will finish your release locally. You then have to push your finished release. git flow does not do this push for you.

    The docs have an example...

    Finishing a release is as simple as:

    $ git flow release finish 1.4.0
    

    This will:

    • Merge changes into the master branch,
    • Create a 1.4.0 tag,
    • Merge changes into the develop branch,
    • Remove your local release\1.4.0 branch.

    Once your release has been finished; you’ll have to push master, develop and tags and also remove remote release/1.4.0 branch (if any):

    (master)  $ git push
    (master)  $ git push --tags
    (master)  $ git checkout develop
    (develop) $ git push
              $ git push {github_username} :release/1.4.0