From 4b7cc248435c6c481946a0aceadf73b097195cda Mon Sep 17 00:00:00 2001 From: Will Hilton Date: Fri, 10 Feb 2017 00:02:01 -0500 Subject: [PATCH] Prompt to push tags attached to HEAD when pushing to remote. --- bin/g | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/g b/bin/g index d2ec7ed..fdf9581 100755 --- a/bin/g +++ b/bin/g @@ -367,6 +367,16 @@ else echo "I will run git push --set-upstream ${remote} ${remote_branch}" git push --set-upstream ${remote} ${remote_branch} fi +tags="$(git tag --points-at HEAD | tr '\n' ' ')" +if [ ! -z "$tags" ] && confirm "Would you like to push these tags (${tags}) to the remote as well?"; then + local_branch=$(git rev-parse --abbrev-ref HEAD) + remote=$(git config --get branch.$local_branch.remote) + echo '' + git push ${remote} ${tags} +else + echo '' + echo 'OK, just thought I'"'"'d ask.' +fi ;; remote)