git commit -m 的问题,开关“m”需要一个值?

anh*_*ask -1 git vim

我有像 git 这样的问题

E235 注意

当我这样做时git commit。然后我试了一下git commit -m,它告诉我error: switch 'm' requires a value

我对此很困惑,你能给我一些想法吗?

ARK*_*ARK 6

-m 开关表示您将添加提交消息(提交名称)。当您输入 -m 时,意味着您将在其后输入一个字符串,例如:

  git commit -m "This is my first commit -  I changed xy class in it"
Run Code Online (Sandbox Code Playgroud)

而且,

 git commit -a -m "add button to signup flow"
Run Code Online (Sandbox Code Playgroud)

等于:

  git add .
  git commit -m "add button to signup flow"
Run Code Online (Sandbox Code Playgroud)

笔记:

  • 这不完全是一个 rails 问题,而是一个 git 问题。
  • 通常以现在时命名您的提交消息,即做这个,做那个等。
  • 原始问题并不完全是您作为问题标题发布的内容。它有两个方面:vim、git。与 rails 或 heroku 无关。