How often do I have to merge changes made with the wizard into my other git branches?

If I have a master branch.

Then I check the work branch and make wonderful changes, and some commit.

Then I need to fix something to go back to master and check the branch named fix , fix what I need to do and merge it into master .

My question is: should I then combine master at work and continue, or should I continue at work , where I was, and merge it when done?

I need to go back to all the branches I'm working on and update (merge the changes) of each branch.

I get the feeling that it is best to unite as soon as possible, but then I will have to constantly update all the branches I'm working on. It's not needed?

+4
source share
3 answers

Check out the always awesome Git Branch Model by Nive:

enter image description here

You see that you should merge fix (not master ) into the work (aka develop ) branch.

How often should you merge with master ? Of course, every stable release.

Any other doubts? Look at the picture .: P

Source: http://nvie.com/posts/a-successful-git-branching-model/

+4
source

In fact, you do not want to do β€œre-mergers,” which is what you are doing. You want to have integration or unlock candidate branches, where you merge into everything you want to see what works. Google "Branch per Feature" to see how to organize your work, synchronize and flexibly.

+3
source

When the master moved forward, we:

 git fetch # get the latest master git checkout my_branch # work in my_branch git rebase master # reply my work on top of newer master 

to update with the changed wizard (for example, when fix was applied to it), and then when we went to merge the branch into

 git checkout master # Do the work in master git merge my_branch # Bring in my branch 

We strive to merge the branch fairly quickly to avoid the need to update changes multiple times.

We only work on 2 or 3 branches per day, and when the branches are shared by developers, we also update them:

 get fetch # Gets the latest version of branches including my_branch git checkout my_branch # Do the work in the my_branch git reset --hard origin/my_branch # Reset to the latest version fetch in. 
0
source

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


All Articles