我有一系列命令在运行git项目之前运行,因此我将它放在bash脚本中。最后我有一个做了块提交: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
已被定义,但消息没有正确传递?任何人都可以看到问题和/或提出解决方案吗?感谢所以。
感谢有额外位。 – hatmatrix