部署到Digital Ocean时出现Shell脚本和GIt挂钩错误

部署到Digital Ocean时出现Shell脚本和GIt挂钩错误,git,shell,githooks,digital-ocean,Git,Shell,Githooks,Digital Ocean,我在DigitalOcean中的水滴位于/var/www/html。然后我用以下信息制作了一个Git钩子 #!/bin/sh git push origin master ssh root@130.122.12.112 'bash -s' < deploy.sh 这是在提交后运行的 然后得到这个错误 :No such file or directory :No such file or directoryhtml/val4505Ecoopsos is not a git command.

我在DigitalOcean中的水滴位于/var/www/html。然后我用以下信息制作了一个Git钩子

#!/bin/sh
git push origin master
ssh root@130.122.12.112 'bash -s' < deploy.sh
这是在提交后运行的

然后得到这个错误

:No such file or directory
:No such file or directoryhtml/val4505Ecoopsos
is not a git command. See 'git --help'.

您的脚本中有DOS行结尾。在脚本上运行dos2unix或类似程序,看看这是否解决了问题。请参阅标签页面的“询问问题代码之前”部分。谢谢!我正在从Git Bash运行脚本。问题如下。。。。。我不确定这些信息是如何相关的。我运行了'dos2unix'来deploy.sh,它运行正常。谢谢
:No such file or directory
:No such file or directoryhtml/val4505Ecoopsos
is not a git command. See 'git --help'.