是否有任何方式,以使在GIT中鉤回波GIT中鉤:使能回聲命令
/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
上的另一mashine
期望的git推輸出:
#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
這僅僅是一個例子,實際的命令鏈可能更復雜
和失敗的地方
我應該將stdout莫名其妙地?
UPDATE
目前我有正常git push
輸出,然後========post-update hook=========
......並沒有什麼
哦! git版本是1.5.6.5
但是當你嘗試時,你的實際輸出是什麼? –
檢查鉤子是否可執行(chmod + x) – sehe