threads / patch / 1596

patchMake git pull default to origin

Subject: [PATCH] Make git pull default to origin

## tl;dr

One message between Aug 19, 2005 and Aug 19, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Amos Waterland· Aug 19, 2005, 22:14 UTC · lore

Currently, typing `git pull' without a third argument will result in an error message. Make it default to orgin, which is what the user typically means.

Signed-off-by: Amos Waterland <apw@rossby.metr.ou.edu>
---
 git-pull-script |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
de9b7753b008a1dc1bdd46f87c76ee3cd9a81d19
Show changes to git-pull-script +9 −2
diff --git a/git-pull-script b/git-pull-script
--- a/git-pull-script
+++ b/git-pull-script
@@ -1,10 +1,17 @@
 #!/bin/sh
 #
 . git-sh-setup-script || die "Not a git archive"
-. git-parse-remote "$@"
+
+if [ $# -eq 0 ]; then
+    remote="origin"
+else
+    remote="$@"
+fi
+
+. git-parse-remote "$remote"
 merge_name="$_remote_name"
 
-git-fetch-script "$@" || exit 1
+git-fetch-script "$remote" || exit 1
 
 git-resolve-script \
 	"$(cat "$GIT_DIR"/HEAD)" \

← back to recent threads