Prompt to push tags attached to HEAD when pushing to remote.

This commit is contained in:
Will Hilton 2017-02-10 00:02:01 -05:00
parent 1663722561
commit 4b7cc24843
No known key found for this signature in database
GPG key ID: 9609B8A5928BA6B9

10
bin/g
View file

@ -367,6 +367,16 @@ else
echo "I will run git push --set-upstream ${remote} ${remote_branch}" echo "I will run git push --set-upstream ${remote} ${remote_branch}"
git push --set-upstream ${remote} ${remote_branch} git push --set-upstream ${remote} ${remote_branch}
fi 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) remote)