is there any way to enable echo in git hook
/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
desired git push output on another mashine:
#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
this is just an example, actual command chain can be more complicated
and fail somewhere
should I redirect stdout to stderr somehow?
UPDATE
currently I have normal git push
output and then ========post-update hook=========
... and nothing
Oh! git version is 1.5.6.5
All output on either stdout or stderr should be forwarded. It's expected to work for all of pre-receive
, update
, post-receive
and post-update
hooks. Echoing commands is enabled with set -x
in bourne shell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With