Possible Duplicate:
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'
Typing gdiff example.php
displays the content of example.php
with less
but ignores the diff part.
Any ideas?