1
0
Fork 0

git: Move fb alias to full command

This commit is contained in:
Jeremy Kaplan 2020-08-07 23:57:51 -07:00
commit 58d3037995
2 changed files with 27 additions and 1 deletions

26
bin/git-fetch-branch Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
export USAGE='<branch>
or: <remote> <branch>
'
# 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}"