Git using the merge command

I cannot do the correct merge of branches in git. For example, I have two branches:

         C - D - E  my_branch
       /    
A - B -  F - G - K  *master

Now I am on the host. After "git merge my_branch", I received several of these from the master:

A - B - C - D - F - G - K - E - M  *master

(M-merge commit) But I also do this:

A - B - F - G - K - M

This is important because on my_branch I often do not compile commits, only for myself; and I don’t want to push them into the master. How to make the merge I want?

+3
source share
2 answers

, , , - , , . , " " git; .

: , , git , , , . , , "".

, , git merge --squash ( git commit). :

A - B - F - G - K - M

, , ( git rebase -i master), , , , git merge, . , :

A - B - F - G - K - M1 - M2 - M3

M1, M2 M3 - , . , , , .

+3

--squash git merge: , .

0

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


All Articles