【发布时间】:2016-08-26 04:49:29
【问题描述】:
我想在我的 Git Bash 上添加新命令(现在我在 Windows 操作系统下)。我试图在 Web 上查看不同的解决方案,但没有找到任何东西。我想添加的命令是:
commitall -> git add --all && git commit -m "$*"
有没有办法在 Windows Git Bash 上添加这个命令?
谢谢
【问题讨论】:
我想在我的 Git Bash 上添加新命令(现在我在 Windows 操作系统下)。我试图在 Web 上查看不同的解决方案,但没有找到任何东西。我想添加的命令是:
commitall -> git add --all && git commit -m "$*"
有没有办法在 Windows Git Bash 上添加这个命令?
谢谢
【问题讨论】:
使用Git aliases,像这样:
git config --global alias.commitall '!git add --all && git commit -m'
没有必要使用$*,因为您指定的所有参数都将简单地附加到上面的行,即如果您运行:
git comitall "a message"
…以下将被执行:
git add --all && git commit -m "a message"
【讨论】: