tinamou_ed
tinamou_ed

Reputation: 43

How do i merge git branch from dev to staging then production

I have just inherited a Drupal project and haven't used git in a while and I have no previous developer to speak to. There are two branches production and staging and equivalent hosting environments.

Would this be a correct workflow:

Git clone repo
Git checkout staging branch
Git pull origin staging
Git create and checkout new feature branch
Git checkout staging branch and merge
Git push to repo

On staging server
Git checkout staging
Git pull origin staging

Assuming this is correct how do I get my changes on to the production branch?

Upvotes: 3

Views: 6636

Answers (1)

Debashish Sarkar
Debashish Sarkar

Reputation: 77

Getting code from develop branch to staging branch:

git clone repo git checkout staging git pull origin develop:staging git commit -m "Commit to Staging" git push

Getting code from staging to master:

git checkout master git pull origin staging: master git commit -m "Commit to master" git push

Upvotes: 1

Related Questions