Git提交字符

Git提交字符,git,Git,我在使用此git命令时遇到问题: git commit -m 'redirect from "/admin" to "/admin/"; wasn't able to use "[/]?$"' 当我按回车键时,它一直转到下一行。这个命令有什么问题,这会有帮助吗 git commit --cleanup=verbatim -m 'redirect from "/admin" to "/admin/"; wasn't able to use "[/]\?$"' 不是中有一个”,因此命令行中有一个

我在使用此git命令时遇到问题:

git commit -m 'redirect from "/admin" to "/admin/"; wasn't able to use "[/]?$"'
当我按回车键时,它一直转到下一行。这个命令有什么问题,这会有帮助吗

git commit --cleanup=verbatim -m 'redirect from "/admin" to "/admin/"; wasn't able to use "[/]\?$"'

不是
中有一个
,因此命令行中有一个未终止的字符串常量。由于shell引用规则,您可以轻松做到的最好方法是
was'\''t
。不过,我建议您在编辑器中编写提交消息:)

尝试以下方法:

git commit -m "redirect from \"admin\" to \"admin\""

尝试使用双引号作为外部标记:

git commit--cleanup=verbatim-m“从“/admin”重定向到“/admin/”;无法使用“[/]\?$”


中的内部单引号不是
这样应该不会有问题。

您有
一词中的
不是
我使用PyCharm,您建议我使用它吗?顺便说一句,这是一个很好的收获。