git - 添加环境变量以提交消息

标签 git bash commit

我如何在 Linux 中将环境变量添加到我的提交消息中?

VERSION="1.0.0"

git commit -m "we add version " + $VERSION + " and that's it"

但这似乎行不通。谁能帮我解决这个问题?

最佳答案

VERSION="1.0.0"
git commit -m "we add version $VERSION and that's it"

无需使用 + 连接字符串,保留双引号内的空格。

关于git - 添加环境变量以提交消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46342375/

相关文章:

xcode - 致命 : Not a git repository (or any of the parent directories): . git-Xcode 4.3 中的错误

git - github怎么让多人push?

Git:添加与推送与提交

eclipse - 如何撤消 Git 回滚

java - 从 git 克隆 Java eclipse 项目时出现 .classpath 文件问题

python - Dulwich 远程 repo 认证

bash - 如何使用数组元素的参数执行 bash 命令?

linux - 使用 BASH 最多排列 N 个字母

linux - bash 空变量命令替换导致单引号

windows - 是否可以使用 --no-verify 标志在 TortoiseGit 中提交?