git config - Is it possible to disable a "dangerous" command line option in git? -
git config - Is it possible to disable a "dangerous" command line option in git? - by habit, i'll work on alter in repo, , add/commit in 1 shot using git commit -am 'my commit message' there times when want add together few of modified files, i'll issue preparatory git add commands meticulously set-up staging area, , separate ready-to-commit changes half-baked changes. then, i'll fat-finger whole thing issuing same git commit -am '...' command do. would there way me disable git commit -a option, and/or issue warning when utilize -a switch? want train myself out of sketchy habit... create wrapper script named git grab bad commands , forwards ones on real git . set before in $path : #!/bin/bash arg in "${@}"; if [ "${arg}" = "-am" ]; echo "hey! don’t that!" 1>&2 exit 1 fi done exec /usr/bin/git "${@}" almost git commands work fine: