Recipe 2.2 Incorporating a finished feature on develop

Problem

You have completed the feature.

Solution

Finished features may be merged into the develop branch definitely add them to the upcoming release:

$ Git checkout develop

$ Git merge --no-ff myfeature

$ Git branch -d myfeature

$ Git push origin develop

$ Git branch -d origin myfeature

Discussion

The --no-ff flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward. This avoids losing information about the historical existence of a feature branch and groups together all commits that together added the feature.

In the latter case, it is impossible to see from the Git history which of the commit objects together have implemented a feature—you would have to manually read all the log messages. Reverting a whole feature (i.e. a group of commits), is a true headache in the latter situation, whereas it is easily done if the --no-ff flag was used.

Yes, it will create a few more (empty) commit objects, but the gain is much bigger that that cost.

results matching ""

    No results matching ""