Created
August 22, 2022 08:16
-
-
Save ductrung-nguyen/6c50d3e0634b851d91cdf152e83f1bd8 to your computer and use it in GitHub Desktop.
Good way to create a git tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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