有什么方法可以在 git hook 中启用 echo
/var/git/repositories/project.git/hooks/post-update
#!/bin/bash
unset GIT_DIR;
echo '========post-update hook========='
cd /var/project;
git reset --hard;
git checkout testing;
git pull;
chmod -R 774 ./lib
update-apps
另一个机器上所需的 git push 输出:
#git push
...
Writing objects: 100% (10/10), 5.98 KiB, done.
Total 10 (delta 3), reused 8 (delta 1)
========post-update hook=========
cd /var/project
git reset --hard
git checkout testing
git pull
chmod -R 774 ./lib
update-apps
这只是一个例子,实际的命令链可能更复杂
并在某处失败
我应该以某种方式将标准输出重定向到标准错误吗?
更新
目前我有正常的git push
输出,然后========post-update hook=========
......什么都没有
哦!git 版本是 1.5.6.5