我已经通过Git将一个网站推送到我的远程服务器,但得到了错误
cannot run post-receive: No such file or directory
Run Code Online (Sandbox Code Playgroud)
所以这些东西在服务器上,它还没有部署到我的/ public文件夹.
但我确实有一个收到后的文件,所以我不确定为什么找不到它.现在我认为我需要做的就是手动运行这个post-receive钩子来进行结账,虽然我不知道怎么做...
Bar*_*end 22
钩子是可执行的shell脚本.如果需要手动运行它,可以从命令行执行它,尽管stdin如果你的repo有多个头(也就是你使用分支),构造预期的inuput有点单调乏味.应该有一个低级命令为你做这个,但我不知道这个.
假设你的git repo中有一个bash shell和一个分支......
# Print the log with full hashes and commit subject, so that you can
# figure out which hashes to use for the FROM and TO range.
/path/to/repo$ git log --pretty=%H\ %s
# assuming the FROM commit identifies as 999988887777
# and te TO commit identifies as 000011112222
# (Note: use the full length hashes; I've shortened them for the example)
/path/to/repo$ .git/hooks/post-receive <<MARK
999988887777 000011112222 refs/heads/master
MARK
Run Code Online (Sandbox Code Playgroud)
......上面应该像真实一样工作.