自动将日期添加到git commit消息

Ste*_*ins 6 linux git bash

所以我有一个sh脚本将一些文件放在一起,然后将它们提交给git repo.如何动态地将日期添加到提交消息中?

我的.sh看起来像

// do things to files...
git add -u;
git commit -m 'generated files on <date here?>';
git push origin master;
Run Code Online (Sandbox Code Playgroud)

hd1*_*hd1 21

只需格式化date命令的输出和Bob的叔叔:

// do things to files...
git add -u;
git commit -m "generated files on `date +'%Y-%m-%d %H:%M:%S'`";
git push origin master
Run Code Online (Sandbox Code Playgroud)