Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将自定义提交消息添加到此git别名?_Git - Fatal编程技术网

如何将自定义提交消息添加到此git别名?

如何将自定义提交消息添加到此git别名?,git,Git,git-config——全局别名.a'!git提交-a-m“提交”和git推送“ 不知道怎么用这个!sh要在别名中使用参数吗 尝试使用临时bash函数: git config --global alias.a '!f() { git commit -am "$1" && git push; }; f' # then use it with git a "My message is awesome." 对我也尝试过$1,但显然我不知道我在

git-config——全局别名.a'!git提交-a-m“提交”和git推送“


不知道怎么用这个!sh

要在别名中使用参数吗

尝试使用临时bash函数:

git config --global alias.a '!f() { git commit -am "$1" && git push; }; f'

# then use it with
git a "My message is awesome."

对我也尝试过$1,但显然我不知道我在做什么…f(){!git commit-am“$1”&&git push;};f:!git:命令不是found@user5531720很抱歉早期的打字错误,已经编辑过了。