Reputation: 1704
I frequently run
git log -10 --author="<author name>" --grep="<story of interest>"
Is it possible to configure a git alias similar to
git by "<author name>" "<story of interest>" -10
that will accomplish the same thing?
The documentation makes no mention of parameters.
Upvotes: 3
Views: 42
Reputation: 94483
You can create alias as a shell command:
git config alias.agrep '!f() { git log -10 --author="$1" --grep="$2"; }; f'
Now call git agrep
with 2 parameters: git agrep Matt test
.
See GitAlias repo for dozens of useful aliases and examples. Full disclosure: I'm a contributor.
Upvotes: 2