aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
495 stars 182 forks source link

Hotfix-finish failed hotfix branch isn't deleted #240

Closed ezienecker closed 4 years ago

ezienecker commented 4 years ago

I have the problem that the Hotifx branch is not cleaned up. I get the following error message with the hotfix-finish command:

[ERROR] Failed to execute goal com.amashchenko.maven.plugin:gitflow-maven-plugin:1.14.0:hotfix-finish (default-cli) on project gitflow-parent: hotfix-finish: warning: not deleting branch 'hotfix/1.4.2' that is not yet merged to
[ERROR]          'refs/remotes/origin/hotfix/1.4.2', even though it is merged to HEAD.
[ERROR] error: The branch 'hotfix/1.4.2' is not fully merged.
[ERROR] If you are sure you want to delete it, run 'git branch -D hotfix/1.4.2'.
...
Caused by: org.apache.maven.plugin.MojoFailureException: warning: not deleting branch 'hotfix/1.4.2' that is not yet merged to
         'refs/remotes/origin/hotfix/1.4.2', even though it is merged to HEAD.
error: The branch 'hotfix/1.4.2' is not fully merged.
If you are sure you want to delete it, run 'git branch -D hotfix/1.4.2'.

Steps to reproduce:

<build>
        <plugins>
            <plugin>
                <groupId>com.amashchenko.maven.plugin</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <version>1.14.0</version>
                <configuration>
                    <pushRemote>false</pushRemote>
                    <versionDigitToIncrement>1</versionDigitToIncrement>
                    <useSnapshotInHotfix>true</useSnapshotInHotfix>
                </configuration>
            </plugin>
        </plugins>
    </build>

Expected behaivor

I would expect that despite a local commit the remote branch can be deleted.

aleksandr-m commented 4 years ago

@ezienecker It is because you haven't pushed it yet. Don't set pushRemote to false and all should be fine.

ezienecker commented 4 years ago

Thanks, works like a charm