File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010#
1111# @options
1212# -q, --quiet Suppress the "Pushing not allowed" warning message and silently exit.
13+ # --tags ALSO pushes tags to remote
1314# options@
1415#
1516# @examples
1617# 1) push
1718# # pushes current branch
1819# 2) push some-other-branch
1920# # pushes some-other-branch...
21+ # 3) push --tags
22+ # # pushes current branch -AND- pushes any tags
2023# examples@
2124#
2225# @dependencies
@@ -39,6 +42,7 @@ if (( numArgs > 0 && numArgs < 3 )); then
3942 until [ -z " $1 " ]; do
4043 [ " $1 " = " --admin" ] && [ " $ADMIN " = " true" ] && isAdmin=true
4144 { [ " $1 " = " -q" ] || [ " $1 " = " --quiet" ]; } && isQuiet=true
45+ [ " $1 " = " --tags" ] && pushTags=true
4246 ! echo " $1 " | egrep -q " ^-" && branch=" $1 "
4347 shift
4448 done
@@ -108,6 +112,14 @@ if [ "$yn" == "y" ] || [ "$yn" == "Y" ]; then
108112 fi
109113fi
110114
115+ if [ $pushTags ]; then
116+ echo
117+ echo " Now ${A} pushing${X} tags to: ${COL_GREEN} ${_remote} ${X} "
118+ echo " $ git push --tags ${_remote} "
119+ git push --tags ${_remote}
120+ echo ${O}${H2HL}${X}
121+ fi
122+
111123hasRemote=$( git config branch.$branch .remote 2> /dev/null)
112124if [ -z " $hasRemote " ]; then
113125 echo
You can’t perform that action at this time.
0 commit comments