Skip to content

Instantly share code, notes, and snippets.

@xphere
Created October 13, 2016 08:55
Show Gist options
  • Save xphere/3c518283063e9a1bb977c7bb4123b279 to your computer and use it in GitHub Desktop.
Save xphere/3c518283063e9a1bb977c7bb4123b279 to your computer and use it in GitHub Desktop.
Bash expansion to append default params onto git commands
#! /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