Alex Rivera | Logout

tags vs branches in git

Asked 2012-08-04T09:32:46.277
9

We have a large rails project that runs on a production and staging server. Is it a good idea to create tags everytime we deploy to staging or production (this would happen automatically with capistrano). Or is better to create branches named "devlopment" and "staging", (master would contain the production status)?

Edit
Report

1 Answer

2

We tag each of our deployements (automatically in our deployment scripts) for the purposes of quick recovery if needed, but they also come in handy as a deployment history. For example:

deployment_stag_20120804
deployment_stag_20120823
deployment_prod_20120715
deployment_prod_20120724

You can make your script keep tags for only the last N number of deployments if you want to avoid a huge amount of tags.

A branch makes more sense if your method of deploying is to merge, for example, into a production branch, upon which a git hook might trigger a pull on the prod server.

answered 2012-08-04T20:42:32.850

Your Answer