如何将时间戳传递给 Git 标签

Lee*_*lly 1 git github

我有兴趣在我的 git master 分支上运行它以获取时间戳版本:

tag -a date_time_as_tag_name -m "new release"
git push tags
Run Code Online (Sandbox Code Playgroud)

是否有一个命令可以为我创建时间戳?

jsc*_*orr 5

在你的 ~/.gitconfig 文件中试试这个:

git config alias.datetag '!git tag `date "+%Y%m%d%H%M"`'
Run Code Online (Sandbox Code Playgroud)