How to pass parameters to an alias?
As answered in Can less retain colored output? I want to use
git diff --color=always filename | less -r to get a colored output of my git diffs. Since I use this a lot it would be nice to set up an alias for this. But how to include the
filename in this command?
I tried the following without success:
alias gdiff='git diff --color=always $1 | less -r'
gdiff example.php displays the content of
less but ignores the diff part.