(Git)如何使用别名设置参数

时间:2016-02-25 08:31:23

标签: git

我使用以下命令

$git commit -am "something message"

设置了别名后,遗憾的是它不能正常工作。

.gitconfig文件是

[alias]
    am = "!f(){ git commit -am \"$1\";};f"

然后我试了,

$ git am "modified something logic"
发生了一些错误。

fatal: could not open 'filepath//modified something logic: No such file or directory

设置别名有什么问题?

感谢。

2 个答案:

答案 0 :(得分:2)

am是一个内置命令:

$ git help am

NAME
   git-am - Apply a series of patches from a mailbox

为您的别名选择其他名称(并检查它是否已经过了......)

答案 1 :(得分:0)

正如LeGEC建议的那样,我将别名更改为coam而不是am。

$ git coam "something message"

之后,我可以使用下面等于 $ git commit -am的命令“消息”

{{1}}
相关问题