How to hotfix
You may encounter an issue that urgently needs to be fixed on the live site, in the middle of a development cycle. Following the suggestions on http://nvie.com/posts/a-successful-git-branching-model/ here is how to do it:
- Switch to master branch and make sure you are up-to-date
git checkout master git pull
- Create hotfix branch and change into it
git branch some-urgent-hotfix git checkout some-urgent-hotfix
- Fix the issue..
- Commit the fix
git commit -a -m "Hotfix for .."
- Instead of fixing in branch you can use git cherry-pick <commit> to pull it from somewhere else
- Merge fix into master
git checkout master git merge --no-ff some-urgent-hotfix
- Merge fix into develop to keep master and develop in sync
git checkout develop git merge --no-ff some-urgent-hotfix
- Push changes in develop and master branch to central repository
- Deploy www and alpha