我有一系列的命令在提交git项目之前需要运行,因此我将它们放在了一个bash脚本中。最后,我有一个模块用于提交:
if [ -z $1 ]; then git commit -a -m "no message"; else; git commit -a -m $1; fi
带有期望的信息传递给脚本。
$ ./dostuff_then_commit "my message"
当我这样做时,我得到了那个结果。
fatal: Paths with -a does not make sense.
因为$1
已经被定义,但是消息没有正确传递?有人能看到问题或建议一个解决方案吗?谢谢SO。