Azima
Azima

Reputation: 4141

Git merging branches

I am trying to merge two branches into a single new branch, and all three branches have a single parent branch in common.

Two branches "feat1" and "feat2" are isolated and branched off from "dev" branch. Now I want to create a new branch, called "next-release" from "dev", and merge "feat1" and "feat2".

What I did :

  1. checked out to "next-release" and merged "feat1".
  2. then merged "feat2".

At this point, I'm getting "Please enter a commit message to explain why this merge is necessary...".

Am I doing it right?

To explain it better:

  dev
   |
----------------
|       |      |
feat1   feat2  next-release = feat1 + feat2

Any help is appreciated. Thanks.

Upvotes: 1

Views: 280

Answers (1)

VonC
VonC

Reputation: 1323145

First, yes, your sequence is correct (provided you did create the integration branch from dev at the point where feat1 and feat2 were created (as it appears to be from your diagram): that way, the merge between feat1 and feat2 benefit from a common ancestor.

Second, the message is, as seen here, a way for your editor called by Git to prompt for a merge message commit: once entered, that will complete the merge.

Upvotes: 1

Related Questions