lypuua

Why timestamp each deployment with Git tag?

I have recently started using capistrano-deploytags. It creates timestamped Git tag at each deployment.

For production deployment:

cap production deploy

It creates tag:

production-2013.04.16-123456

For staging deployment:

cap staging deploy

It creates tag:

staging-2013.04.16-123456

Having those tags, you can add this to your ~/.gitconfig

[alias]
   pdiff = !TAG=$(git describe --no-abbrev --tags --match production-*) && git diff $TAG
   sdiff = !TAG=$(git describe --no-abbrev --tags --match staging-*) && git diff $TAG

Those aliases allow you see all commits that you are about to deploy to staging or production. It makes it faster to do check code changes before they are deployed to production and write better customer update mails.

After deployment with capistrano-deploytags and making a few commits an/or local changes, you can view diff to what is deployed to production with

git pdiff

2 Responses
Add your response

5629
372345 23304565 2127851301 n

Any thoughts on the error I keep getting about a "bad config" file when I add those two lines in?

over 1 year ago ·
5641
09809b573afd2ad5e84d368796fd24b1

@clepore It was _ in alias name, fixed.

over 1 year ago ·