Git 空提交和没有消息的提交

如果要将空提交推送到 Git 仓库,可以使用命令 git commit--allow-empty 选项:

git commit --allow-empty -m "Empty commit"

如果要将没有消息的提交推送到 Git 仓库,可以使用命令 git commit--allow-empty-message 选项:

git add .
git commit --allow-empty-message -m ""

最后,推送到 Git 仓库:

git push

相关文章:

参考:

  1. 如何在 Git 中推送一个空的提交
  2. Git commit with no commit message - Stack Overflow
Built with Hugo
主题 StackJimmy 设计