How do I set up a parameterized git alias?
I often run
git log -10 --author="<author name>" --grep="<story of interest>"
Is it possible to set up a git alias similar to
git by "<author name>" "<story of interest>" -10
what will do the same thing?
The documentation does not mention parameters.
source to share
You can create an alias as a shell command:
git config alias.agrep '!f() { git log -10 --author="$1" --grep="$2"; }; f'
Now call git agrep
with two parameters git agrep Matt test
.
See the GitAlias ββrepo for dozens of useful aliases and examples. Full disclosure: I am the author.
source to share