我正在尝试在 Windows 环境中设置 git post-update 挂钩。这是代码:
#!/bin/sh
cd /c/inetpub/vhosts/mywebsite || exit
unset GIT_DIR
git pull hub master
exec git-update-server-info
当我从 shell(sh 更新后)运行它时,一切都很好。但是推送后我有一个错误:
hooks/post-update: line 7: cd: /c/inetpub/vhosts/mywebsite: Not a directory
我做错了什么?