Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

push: --set-upstream while pushing (same as -u)

  • Loading branch information...
commit 32e7bec0905b1cbb7168c6c4b3e067698a6fc40e 1 parent 1945857
@jamiew authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 push
View
6 push
@@ -1,5 +1,5 @@
#!/bin/sh
-#
+#
# Usage: push
#
# Send your local branch changes to the remote branch,
@@ -8,13 +8,13 @@
#
# Any extra args to this command will be passed through to 'git push',
# e.g. for doing "push -f"
-#
+#
remote=origin
branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
# Push & save output
-push=$(git push $* $remote $branch 2>&1)
+push=$(git push --set-upstream $* $remote $branch 2>&1)
exit_code=$?
if [ $exit_code != 0 ]; then
echo "Ouch, push failed! code=$exit_code, output=$push"
Please sign in to comment.
Something went wrong with that request. Please try again.