Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to best manage a Git repository for a website in 3 stages?

Tags:

git

workflow

I was wondering after having some issues with Git what the best way to handle the repo for a website. Currently we have 3 versions of a website; production, beta and development. We've set the Git repo up much the same with 3 branches, master (production), beta (beta), develop (development).

Once we get done with a set of changes/features, we update the development branch then we copy that branch to branch beta. All the while development still continues on the develop branch with more new features etc.

The problem we're having is that inevitably while the code is in beta, bugs are found. Those bugs need to be fixed in both develop and beta branches. Meanwhile more development has been done on the develop branch that doesn't and shouldn't belong in the beta branch so we can't really merge beta and development branches can we? I also don't really want to go through the time and trouble of having to make individual commits to both repos with the change that applies to both.

So what I'm looking for is the best way to manage this type of work flow with Git.

Thanks

like image 638
Ryan Avatar asked Dec 14 '11 20:12

Ryan


2 Answers

Check out git-flow (aka: A successful Git branching model). Production runs from the master branch, develop from develop and beta from the current release branch (if there is one).

Edit: This answer points to the same approach as the answer by Justin

like image 122
tback Avatar answered Oct 07 '22 18:10

tback


One of the better approaches I've seen for a concurrent dev-qa-release workflow is "A successful Git branching model". The aha moment for me was the use of --no-ff to create a "roll-up" commit into the development branch -- this makes features and bugfixes easy to manage.

like image 37
Justin ᚅᚔᚈᚄᚒᚔ Avatar answered Oct 07 '22 18:10

Justin ᚅᚔᚈᚄᚒᚔ