简体   繁体   中英

Git master and dev branches: how to

We have 2 branches in a repository aaa/project :

  • master is for production
  • dev is for developpement

Every developper forks aaa/project ( developer-name/project ) and create branches for each feature. When a feature is ok, developer push to his branch, then do a pull request to aaa/project on dev branch.

Sometimes, dev branch (from aaa/project ) is merged into master branch (with 3 or 4 well tested feature).

My problem is:

If something is pushed to master branch (critical bug that needs to be in prod ASAP, assuming we have CI), dev branch is not up to date with master branch (on aaa/project ).

How can we have dev branch just like master branch just after we merged dev into master ?

We are using git and bitbucket for hosting (I would prefer a solution directly in bitbucket, because we only clone from our repositories ( developer-name/project )).

Hope it's clear enough, thanks a lot.

As trnelson is saying. It is completely normal to merge also from master branch to dev branch. You could take a look on this excellent presentation about git branching model from Lemi Orhan Ergin! In our company we have implemented our git workflow according to this presentation.

I'm attaching a screenshot of one slide which, I think, is your case. 生产中的热修复

This is the link for the whole presentation Git Branching Model

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM