Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How often should I merge changes commited on master - to my other git branches?

Tags:

git

If I have a master branch.

I then checkout a work branch and make awesome changes, and some commits.

Then I have to fix something so I go back to master and checkout a branch called fix, fix what I need to do, and merge it into master.

My question is, should I then merge master onto work and continue, or should I continue on work where I was and merge it when I'm done?

I find myself having to go back to all the branches I work on and updating (merging changes to) each branch.

I get the feeling it's best to merge asap, but then find myself having to continuously update all the branches I work on. Is this unnecessary?

like image 475
d-_-b Avatar asked Sep 27 '12 23:09

d-_-b


1 Answers

Refer to the always awesome Git Branching Model by Nive:

enter image description here

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

How often should you merge to master? Every stable release, of course.

Any other doubts? Look at the picture. :P

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

like image 145
Theraot Avatar answered Nov 14 '22 22:11

Theraot