Git - Combining patch in dev and master causes discrepancy

I am following a successful Git branching model (aka git -flow).

I installed the patch in accordance with the instructions in the Completing the patch branch section.

I created a patch branch from the server:

> git checkout -b hotfix upstream/master

I did some work and manually combined them into master:

> git checkout master 
> git merge --no-ff hotfix

Then manually merge it back into dev:

> git checkout dev
> git merge --no-ff hotfix

I did some more work against dev. Everything seemed beautiful. But then, when I went to unify dev into a master, he could not.

> git checkout master
> git merge --ff-only dev
fatal: Not possible to fast-forward, aborting.

It seems that fixing the merge from the fix is ​​the difference.

I assumed that after this process the general history will remain. What have I done wrong?

+4
source share
1

, , , hotfix

$ git checkout -b hotfix upstream/master
$ git lola
* 81a514a (dev) Stupendous feature
* cb4d5e6 Great feature
* d4a7906 Cool feature
| * 39e449a (HEAD, upstream/master, hotfix) v0.2
|/
* 264ddbc (master) v0.1

: git lola - , .

hotfix master

*   567f066 (HEAD, master) Merge branch 'hotfix'
|\
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
| * 81a514a (dev) Stupendous feature
| * cb4d5e6 Great feature
| * d4a7906 Cool feature
|/
* 264ddbc v0.1

hotfix dev - , .

*   36aa1c8 (HEAD, dev) Merge branch 'hotfix' into dev
|\
* | 81a514a Stupendous feature
* | cb4d5e6 Great feature
* | d4a7906 Cool feature
| | *   567f066 (master) Merge branch 'hotfix'
| | |\
| |/ /
|/| /
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1

master dev, .

dev master .

* d89aa74 (HEAD, dev) Jason does it again
* a4dd5bf Jason saves the day
*   36aa1c8 Merge branch 'hotfix' into dev
|\
* | 81a514a Stupendous feature
* | cb4d5e6 Great feature
* | d4a7906 Cool feature
| | *   567f066 (master) Merge branch 'hotfix'
| | |\
| |/ /
|/| /
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1

, dev master , --no-ff . , release-1.0 .

* f0398ba (HEAD, release-1.0) Bugfix for v1.0
* d89aa74 (dev) Jason does it again
* a4dd5bf Jason saves the day
*   36aa1c8 Merge branch 'hotfix' into dev
|\
* | 81a514a Stupendous feature
* | cb4d5e6 Great feature
* | d4a7906 Cool feature
| | *   567f066 (master) Merge branch 'hotfix'
| | |\
| |/ /
|/| /
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1

, , master

$ git merge --no-ff -m "v1.0" release-1.0
$ git lola
*   5a384c8 (HEAD, master) v1.0
|\
| * f0398ba (release-1.0) Bugfix for v1.0
| * d89aa74 (dev) Jason does it again
| * a4dd5bf Jason saves the day
| *   36aa1c8 Merge branch 'hotfix' into dev
| |\
| * | 81a514a Stupendous feature
| * | cb4d5e6 Great feature
| * | d4a7906 Cool feature
* | |   567f066 Merge branch 'hotfix'
|\ \ \
| |/ /
|/| /
| |/
| * 1b1b6e3 (hotfix) Fix nasty bug
| * 39e449a (upstream/master) v0.2
|/
* 264ddbc v0.1

, .

+4

Source: https://habr.com/ru/post/1523558/


All Articles