git: Move fb alias to full command
This commit is contained in:
parent
2353cf16d0
commit
58d3037995
2 changed files with 27 additions and 1 deletions
26
bin/git-fetch-branch
Executable file
26
bin/git-fetch-branch
Executable 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}"
|
||||||
|
|
@ -33,7 +33,7 @@ dc = diff --cached
|
||||||
d = diff
|
d = diff
|
||||||
dn = diff --name-only --relative
|
dn = diff --name-only --relative
|
||||||
dw = diff --word-diff
|
dw = diff --word-diff
|
||||||
fb = "!fb() { git fetch \"$1\" \"$2\":\"$2\"; }; fb"
|
fb = fetch-branch
|
||||||
f = fetch
|
f = fetch
|
||||||
fp = fetch --prune
|
fp = fetch --prune
|
||||||
fixup = commit --amend --no-edit
|
fixup = commit --amend --no-edit
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue