目前,我有以下别名
[alias]
comment = commit -m
它适用于
git comment 'Export env'
但想让它在没有引号的情况下工作
[alias]
comment = !"git commit -m ${*}"
这会遇到错误
$ git comment Export env
error: pathspec 'env' did not match any file(s) known to git
error: pathspec 'Export' did not match any file(s) known to git
error: pathspec 'env' did not match any file(s) known to git
您可以调用 shell。例如:
[alias]
comment = !bash -c 'git commit -m \"$*\"' _