Skip to content

Commit f9417bf

Browse files
author
Chris Corwin
committed
(CSC---fixing-push-set-upstream) fixed push.sh to have remotes work and set-upstream work
1 parent b77b139 commit f9417bf

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

push.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
#
1111
# @options
1212
# -q, --quiet Suppress the "Pushing not allowed" warning message and silently exit.
13-
# --tags ALSO pushes tags to remote
1413
# options@
1514
#
1615
# @examples
1716
# 1) push
1817
# # pushes current branch
1918
# 2) push some-other-branch
2019
# # pushes some-other-branch...
21-
# 3) push --tags
22-
# # pushes current branch -AND- pushes any tags
2320
# examples@
2421
#
2522
# @dependencies
@@ -42,7 +39,6 @@ if (( numArgs > 0 && numArgs < 3 )); then
4239
until [ -z "$1" ]; do
4340
[ "$1" = "--admin" ] && [ "$ADMIN" = "true" ] && isAdmin=true
4441
{ [ "$1" = "-q" ] || [ "$1" = "--quiet" ]; } && isQuiet=true
45-
[ "$1" = "--tags" ] && pushTags=true
4642
! echo "$1" | egrep -q "^-" && branch="$1"
4743
shift
4844
done
@@ -112,21 +108,13 @@ if [ "$yn" == "y" ] || [ "$yn" == "Y" ]; then
112108
fi
113109
fi
114110

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-
123111
hasRemote=$(git config branch.$branch.remote 2> /dev/null)
124112
if [ -z "$hasRemote" ]; then
125113
echo
126114
echo ${Q}"Setup remote tracking of ${COL_GREEN}${_remote}${Q} for ${B}\`${branch}\`${Q}? (y) n"
127115
read yn
128116
if [ -z "$yn" ] || [ "$yn" = "y" ]; then
129-
git branch --set-upstream-to=$_remote/$branch $branch
117+
git branch --set-upstream $_remote/$branch $branch
130118
fi
131119
fi
132120

0 commit comments

Comments
 (0)