Jakov
Jakov

Reputation: 989

Git: last merge commit ignored

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?

Upvotes: 1

Views: 49

Answers (1)

TTT
TTT

Reputation: 28869

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.

Upvotes: 2

Related Questions