Skip to content

Commit

Permalink
Add a git tag option on git commands
Browse files Browse the repository at this point in the history
  • Loading branch information
BosEriko committed Jul 6, 2019
1 parent e533ddf commit ea01133
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ GIT_HELP_MESSAGE="
s Alias for status
so, set-origin Set the origin path
st Alias for stash
t, tag Tag and push
w, wtf Commit with an automated message
"
Expand Down Expand Up @@ -175,6 +176,19 @@ g() {
git remote set-url --add --push origin $gitlab_path
git remote set-url --add --push origin $bitbucket_path
git remote -v
elif [ "$1" = "t" ] || [ "$1" = "tag" ]; then
if [ -z "$2" ]; then
echo "Please specify a release name"
else
echo "Do you want to tag and push '$2'? [Y/N]"
read tag_decision
if [ "$tag_decision" = "Y" ] || [ "$tag_decision" = "y" ]; then
git tag $2 -a
git push origin $2
else
echo "Tagging was cancelled."
fi
fi
else
git $@
fi
Expand Down

0 comments on commit ea01133

Please sign in to comment.