Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Hotfix Git Workflow

cam156 edited this page Jun 16, 2017 · 13 revisions

Branching model for Hotfix based off: http://nvie.com/posts/a-successful-git-branching-model/

Make sure to make hotfix changes are in a separate branch so they can be merged back into develop and master separately.

Make Changes

  1. Pull latest into master: git checkout master, then git pull origin master

  2. Branch from master, not from develop: git checkout -b release-x.y.z master

  3. Make changes and test

Push Changes

Merge your changes back into master and prepare to deploy them out to the servers.

  1. git fetch

  2. git checkout master

  3. git pull origin master

  4. git merge release-x.y.z master

  5. git tag -a vx.y.z -m 'Hotfix for release vx.y.z'
    You can find the version numbers: https://github.com/psu-stewardship/scholarsphere/releases

  6. git push origin master

  7. git push --tags

Deploy to Staging

Test the deployment to staging. Have you changed the Data model? Yes? Go to Step 1. No? Go to Step 2.

  1. cap stage_new deploy BRANCH_NAME=master

Deploy to Production

Have you changed the Data model? Yes? Go to Step 1. No? Go to Step 2.

  1. Deploy during the maintenance window
cap prod_new  deploy BRANCH_NAME=master

Post-Deploy Cleanup

Include the new released version in the develop branch.

  1. git fetch

  2. git checkout develop

  3. git pull origin develop

  4. git merge release-x.y.z develop

Now the hotfix branch can be deleted

  1. git branch -d release-x.y.z

  2. git push origin :release-x.y.z

Clone this wiki locally