Skip to content

Commit

Permalink
(master) added ability to push tags as well by passing --tags flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cmcculloh committed May 6, 2013
1 parent a17a460 commit b77b139
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
#
# @options
# -q, --quiet Suppress the "Pushing not allowed" warning message and silently exit.
# --tags ALSO pushes tags to remote
# options@
#
# @examples
# 1) push
# # pushes current branch
# 2) push some-other-branch
# # pushes some-other-branch...
# 3) push --tags
# # pushes current branch -AND- pushes any tags
# examples@
#
# @dependencies
Expand All @@ -39,6 +42,7 @@ if (( numArgs > 0 && numArgs < 3 )); then
until [ -z "$1" ]; do
[ "$1" = "--admin" ] && [ "$ADMIN" = "true" ] && isAdmin=true
{ [ "$1" = "-q" ] || [ "$1" = "--quiet" ]; } && isQuiet=true
[ "$1" = "--tags" ] && pushTags=true
! echo "$1" | egrep -q "^-" && branch="$1"
shift
done
Expand Down Expand Up @@ -108,6 +112,14 @@ if [ "$yn" == "y" ] || [ "$yn" == "Y" ]; then
fi
fi

if [ $pushTags ]; then
echo
echo "Now ${A}pushing${X} tags to: ${COL_GREEN} ${_remote} ${X}"
echo "$ git push --tags ${_remote}"
git push --tags ${_remote}
echo ${O}${H2HL}${X}
fi

hasRemote=$(git config branch.$branch.remote 2> /dev/null)
if [ -z "$hasRemote" ]; then
echo
Expand Down

1 comment on commit b77b139

@cmcculloh
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue #83

Please sign in to comment.