Git别名日志在日期后更改

Git别名日志在日期后更改,git,Git,我有一个别名,我想与代码maat一起使用,但不知道如何在运行别名时将其添加到后面的位置。这可能吗?例如,下面是我想介绍的内容: alias gmaat = 'git log --pretty=format:"[%h] %an %ad %s" --date=short --numstat --after=YYYY-MM-DD' 所以我需要做的是,当我运行Gmat别名时,系统会提示我添加--after日期,或者我会运行 gmaat YYYY-MM-DD // filling in the date

我有一个别名,我想与代码maat一起使用,但不知道如何在运行别名时将其添加到后面的位置。这可能吗?例如,下面是我想介绍的内容:

alias gmaat = 'git log --pretty=format:"[%h] %an %ad %s" --date=short --numstat --after=YYYY-MM-DD'
所以我需要做的是,当我运行Gmat别名时,系统会提示我添加--after日期,或者我会运行

gmaat YYYY-MM-DD // filling in the date
如果这是可能的,我感谢事先可以给予的帮助

编辑

我尝试了下面的第一个答案,添加了以下内容:

alias gmaat='!f() { git log --pretty=format:"[%h] %an %ad %s" --date=short --numstat --after=$1 }; f'
当我运行此命令并在别名后添加日期时,我收到以下错误:

fatal: ambiguous argument '2014-11-01': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
fatal:参数“2014-11-01”不明确:未知修订或路径不在工作树中。
使用“---”将路径与修订分开,如下所示:
'吉特[…]-[…]'
您可以使用:

注意“
{xxx;}

这样,就可以将
YYYY-MM-DD
作为参数传递

git gmaat YYYY-MM-DD // filling in the date
如果不使用git配置别名,则需要:

然后:


非常感谢你。我刚刚修复并测试了答案的第一部分:git别名可以工作。
git gmaat YYYY-MM-DD // filling in the date
gmaatf() { git log --pretty=format:"[%h] %an %ad %s" --date=short --numstat --after=$1 }
 alias gmaat=gmaatf