Last Updated: May 17, 2017
· tb

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:


For staging deployment:

cap staging deploy

It creates tag:


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

   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
Say Thanks

2 Responses
Add your response

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 ·

@clepore It was _ in alias name, fixed.

over 1 year ago ·