Created
October 13, 2016 08:55
-
-
Save xphere/3c518283063e9a1bb977c7bb4123b279 to your computer and use it in GitHub Desktop.
Bash expansion to append default params onto git commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
function git() { | |
CMD= | |
PARAMS= | |
if [[ $# -gt 0 ]]; then | |
CMD="$1" | |
shift | |
case "$CMD" in | |
"fetch") | |
PARAMS="--no-tags" | |
;; | |
esac | |
fi | |
command git $CMD $@ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment