diff --git a/bin/git-fetch-branch b/bin/git-fetch-branch new file mode 100755 index 0000000..668c298 --- /dev/null +++ b/bin/git-fetch-branch @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +export USAGE=' +or: +' + +# This is the recommended pattern from `man git-sh-setup`. +# +# shellcheck disable=SC1090 +. "$(git --exec-path)/git-sh-setup" + +set -euo pipefail + +case "$#" in + 1) + remote='origin' + branch="$1" + ;; + 2) + remote="$1" + branch="$2" + ;; + *) usage ;; +esac + +exec git fetch "${remote}" "${branch}" diff --git a/git/config b/git/config index 8675016..d2219a6 100644 --- a/git/config +++ b/git/config @@ -33,7 +33,7 @@ dc = diff --cached d = diff dn = diff --name-only --relative dw = diff --word-diff -fb = "!fb() { git fetch \"$1\" \"$2\":\"$2\"; }; fb" +fb = fetch-branch f = fetch fp = fetch --prune fixup = commit --amend --no-edit