先生们,告诉我是否有人知道PLZ。
git config --global alias.com "commit -a -m \"$(date +\"%H:%M:%S_%d-%m-%Y\")\""
结果给出了在提交中创建别名的时间戳
git config --global alias.com "commit -a -m \"\$(date +\"%H:%M:%S_%d-%m-%Y\")\""
也
git config --global alias.com 'commit -a -m "$(date +"%H:%M:%S_%d-%m-%Y")"'
实际上在提交中给出"$(date +"%H:%M:%S_%d-%m-%Y")"。
bashevsky 别名工作正常
alias gcom='git commit -a -m "$(date +"%H:%M:%S_%d-%m-%Y")"'
但如果可以通过 git 别名来做到这一点,我想这样做。
别名文本只能包含以下两种内容之一:git程序的命令或 shell 的命令(在这种情况下,文本必须以字符开头
!)。但是在 shell 命令中,当然,您可以执行(包括)带有必要参数的git程序,例如:
对于您的示例,创建别名的命令可能是: