Where developers come to connect, share, build and be inspired.


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


  • 372345_23304565_2127851301_n

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

  • 09809b573afd2ad5e84d368796fd24b1

    @clepore It was _ in alias name, fixed.

Add a comment