+2
Completed

Git-Flow Finish Feature: support mixture of rebase and merge

George Bessonov 7 years ago updated by Marc Strapetz 5 years ago 5

Assume my local master is behind the remote one.

Assume feature branch is rebased to local master head.

If I do git-flow finish and choose merge-commit feature finishing option, I'll get an option to fast-forward local master to the remote one. I would like to have an option to rebase feature branch on the new master head before merging also, to have repo structure like this:

but not like this:

Please make clear in your screenshot what master, origin/master is and what the feature and feature/origin are.

Example repo structure:

If I choose to finish Feature-1 by merge-commit, I'll get an option to fast-forward master branch before merging or cancel the operation. If I do so, I'll get the following repo structure (assuming I didn't check the "Delete feature branch" checkbox):

which looks pretty ugly for me.


I prefer my repos to look like this:


As for now, I have to do the following steps to get repo structure from the example one to the preffered one:

  1. Rebase Feature-2 onto origin/master.
  2. Resolve any conflicts if any.
  3. Git-Flow finish (merge-commit).
  4. Agree to fast-forward master.

The idea is to merge steps 1-2 into step 4 so the workflow will be like this:

  1. Git-Flow finish (merge-commit)
  2. If master is behind
    1. Agree to fast-forward master OR
    2. Agree to fast-forward master then rebase onto it OR
    3. Cancel Git-Flow finish
  3. If (b.) is choosen and some conflicts appeared during rebase
    1. Follow to conflict resolving OR
    2. Cancel Git-Flow finish.

It would also be great if there will be an ability to configure default behaviour if master is behind, e.g. automatticaly choose (a.), (b.) or (c.) in such a case. It may be done as a checkbox "remember as default" in the option choosing dialog box or as some settings or configs parameter.

AFAIU, this is exactly what Git-Flow AVH option"gitflow.feature.finish.rebase" does?

Completed

Completed in 19.1 preview 5.