Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to successfully keep master and development branches in sync? GIT

Tags:

git

branch

merge

I like to do development on my development branch then merge into master when I am ready to push to production. As long as I don't commit anything to the master branch all goes smoothly.

However, I have come across situations where I have committed something to the master branch that conflicts with something that was changed on the development branch. When I merge the development branch into the master I have to resolve the conflict. No big deal, but then in order to make sure the development branch has everything in the master branch (making sure development is up-to-date) I merge the master branch in and end up having to resolve the conflicts again.

I've heard that rebasing is generally bad, especially for things you are pushing out publicly.

Is there a better way to manage this type of setup?

like image 914
chadgh Avatar asked Feb 28 '13 20:02

chadgh


Video Answer


1 Answers

Periodically merge from the master to your development branch, and resolve any conflicts then. (If you're doing that regularly, conflicts will generally be very minor.)

By the time the merge back to master happens, development shouldn't conflict at all.

like image 114
cHao Avatar answered Sep 20 '22 16:09

cHao