
| Current Path : /bin/X11/X11/X11/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //bin/X11/X11/X11/git-alias |
#!/usr/bin/env bash
# reset environment variables that could interfere with normal usage
unset GREP_OPTIONS
# put all utility functions here
# make a temporary file
git_extra_mktemp() {
mktemp -t "$(basename "$0")".XXXXXXX
}
usage() {
cat <<HERE
usage: git alias # list all aliases
or: git alias <search-pattern> # show aliases matching pattern
or: git alias <alias-name> <command> # alias a command
HERE
}
case $# in
0) git config --get-regexp 'alias.*' | sed 's/^alias\.//' | sed 's/[ ]/ = /' | sort ;;
1) git alias | grep -e "$1" ;;
2) git config --global alias."$1" "$2" ;;
*) >&2 echo "error: too many arguments." && usage && exit 1 ;;
esac