Every time I do git diff
I'd like my bash to do clear & git diff
instead.
I tried to tweak an answer at "Bash: Spaces in alias name" like this:
git() {
if [[ $@ == "diff" ]]; then
command clear && git diff
else
command git "$@"
fi
}
But unfortunately, this does not work (the command line ends up in a sort of infinite loop switching between bash
and git
forever and I need [CTRL|CMD]+C
to break from it).