I want to create an alias in bash, such that
git diff somefile
becomes
git diff --color somefile
But I don’t want to define my own custom alias like
alias gitd = "git diff --color"
because if I get used to these custom alias, then I loose the ability to work on machines which don’t have these mappings.
Edit: It seems bash doesn’t allow multi-word alias. Is there any other alternative solution to this apart from creating the alias?
Better answer (for this specific case).
From
git-configman page:No function or alias needed. But the function wrapper approach is general for any command; stick that card up your sleeve.