を命令エコー有効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
これはほんの一例、実際のコマンドチェインより複雑
なると私は標準出力をリダイレクトする必要があり、どこか
失敗する可能性がありますどういうわけかstderrに?
UPDATE
は、現在、私は通常のgit push
出力を持ち、その後========post-update hook=========
...と何も
ああ! gitのバージョンは1.5.6.5
しかし、試したときの実際の出力は? –
フックが実行可能であることを確認する(chmod + x) – sehe