#!/usr/bin/env ruby tag = ARGV[0] if tag timestamp = `date -u +'%Y%m%d%H%M%S'` full_tag = "#{tag}/#{timestamp}" tag_exists = `git log HEAD --no-walk -1 --pretty='%h%d'`.include? "tag: #{tag}" if tag_exists puts "Already tagged #{tag}!" exit 0 end `git tag #{full_tag}` `git push origin #{full_tag}` end