1

These are my steps.

Step 1: Merge develop into feature

Step 2: Check if everything is OK and immediately afterwards merge feature into develop

When I did that I got the following situation:

CURRENT

Only "merge develop into feature" is shown and "merge feature into develop" is not shown.

I would like that both merge commits are shown, like in the following picture.

WANTED

Can someone tell me how can I achieve this?

Jakov
  • 879
  • 2
  • 17
  • 36

1 Answers1

2

If you do this fast enough, before anyone adds new commits to develop, then by default Git will do a fast-forward merge. To prevent it, just add --no-ff to your merge command back into develop:

git fetch
git branch -d develop # to make sure you aren't using an out of date copy
git checkout develop
git merge feature --no-ff

Side note: many workflows recommend rebasing feature onto develop before the merge back into develop, instead of merging develop into feature first.

TTT
  • 22,611
  • 8
  • 63
  • 69