There is a main branch (master) and there is a branch that was once inherited from it (design) . Also this branch lies on the remote side.

After the master mergit commits (from other branches). And changes were made to the design branch.

Visually looks like this

enter image description here

Red line - master, green - design

I want the desing branch desing have all the changes made in the wizard. (after design3 was all changes from master6 )

I do the following:

 git checkout design // она же указывает на origin/desing git pull origin master 

And after that, I propose to smuggle the branches, and then when I push, I have a comit that was made in the master branch.

How do I apply all changes from master to desing ? (you do not want to commit those commits that were in the master. Or is it unrealistic?)

  • one
    So you want or don't want commits from master to design? The penultimate sentence is woven out of contradictions. - free_ze
  • @free_ze I want to update the desing branch to the state of the last commit from the wizard. If I do as I described in the question, then when I push, I will have Comits from the master. - Andrew Bystrov
  • The master state consists of commits, why does it bother you? Tracked change history is cool. But if you do not need it, then try rebase. - free_ze
  • I think you need such a git pull && git checkout design && git rebase master design - KoVadim
  • @KoVadim do this in the master branch? - Andrew Bystrov

1 answer 1

If you want to have all changes to the master branch in design3, then after merging the branches, you can’t send only design or master commits via git push to a remote repository.

In order for all changes from master to be in the design branch, you must first switch to the design branch:

 git checkout design 

Then, perform the move:

 git rebase master 
  • Thanks, it helped. But all the same, I was merged by a master in design and pushing into an already removed branch of design. Then (I hope) I can normally carry the design into the master - Andrew Bystrov
  • @AndrewBystrov For the future: try to use master as the main branch. The same branch is usually used for releases or production. - shokuroff
  • The @macishOk thing is that the design branch is a parallel branch that lives for a long time. As soon as everything is done there, she will be smiled in the master. You just want to pre-master merzhn in design, so that there are fewer conflicts in the future. - Andrew Bystrov