Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ductrung-nguyen/6c50d3e0634b851d91cdf152e83f1bd8 to your computer and use it in GitHub Desktop.
Save ductrung-nguyen/6c50d3e0634b851d91cdf152e83f1bd8 to your computer and use it in GitHub Desktop.
Good way to create a git tag
Good way to create a git tag to keep the commiter date, name and email
#!/bin/bash
tag=$1
echo "Updating $tag"
date=$(git show ${tag}^0 --format=%aD | head -1)
email=$(git show ${tag}^0 --format=%aE | head -1)
name=$(git show ${tag}^0 --format=%aN | head -1)
GIT_COMMITTER_DATE="$date" GIT_COMMITTER_NAME="$name" GIT_COMMITTER_EMAIL="$email" git tag -s -f ${tag} ${tag}^0 -m ${tag}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment