7. Deploy
production
master
Integrate MASTER → PRODUCTION branch.
Create a tag.
Make deploy.
v1.0
web
server
deploy
$ git checkout PRODUCTION
$ git merge master
$ git tag -a v1.0 -m '1st running version o/'
$ run_my_deploy_script
9. Create a branch
production
hotfix
master
To fix problems
v1.0
$ git checkout PRODUCTION
$ git checkout -b HOTFIX
10. Do commits
production
hotfix
master
In branch HOTFIX
v1.0
$ git add program_with_error.py
$ git commit -m 'I fixed that'
11. Deploy
production
hotfix
master
Integrate HOTFIX → PRODUCTION.
Create a tag.
Run deploy.
v1.0
web
server deploy
v1.0.1
$ git checkout PRODUCTION
$ git merge HOTFIX
$ git tag -a v1.0.1 -m 'Fixed that annoying bug'
$ run_my_deploy_script
13. Merge
production
master
Integrate PRODUCTION→MASTER
v1.0
v1.0.1
$ git checkout master
$ git merge PRODUCTION
14. Merge
production
master
Integrate PRODUCTION→ MASTER
v1.0
v1.0.1
Now, MASTER has
the same fix
PRODUCTION
already had.
15. Why branches?
● Old code untouched until the new one works.
● Production kept away from development and
maintenance
● So:
– Never commit on MASTER
– Never commit on PRODUCTION
– Just merge onto them
16. Why tags?
● To rewind/forward versions easily
– Just a git checkout <tag>
– Simplicity and speed when something goes wrong