git - TortoiseGit with server-sided hooks (through http) -
first of thank wonderful website (yes i'm new, @ least writer :p).
since didn't found here answer problem try ask directly :) saw here maybe http related don't know post quite old ...
the main problem:
i want make hook run on remote server (on linux system).
when try act client doing tortoisegit clone trying commit , push modifications, completed without launching remote script present in .git/hooks
folder on remote server repository. tried script named update
, , pre-receive
. script have echo "hello" , doesn't print anywhere when launching.
what i've checked:
the extension ".sample" gone, scripts can executed, own user account, did manage make hooks work on client side (like prepare-commit-msg
).
a more detailed example:
in order go further did try commit , push not through tortoisegit on windows (like client) directly sort of local testing on linux server (to investigate closer problem before trying again tortoisegit...).
git clone http://{id}@{serv}.corp/git/{folder}/{repo}.git . cloning '.'...
(the clone okay), switch test branch
git checkout test_hook branch test_hook set track remote branch test_hook origin. switched new branch 'test_hook'
(the branch i've created test hooks)
commit random modifications
git commit -a -m "test command line" [test_hook a464a3e] test command line 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 makefile
and pushing
git push --progress "origin" test_hook:test_hook fetching remote heads... refs/ refs/tags/ refs/heads/ updating 'refs/heads/test_hook' 6d65df53f962a12e8445a137de173f50eeade819 a464a3ef2cfca3648a4b7b4e94f377f13b82f852 sending 3 objects done updating remote server info http://{id}@{serv}.corp/git/{folder}/{repo}.git 6d65df5..a464a3e test_hook -> test_hook
i tried place script both in {folder}/{repo}.git/hooks/
folder , main {folder}/hooks
even hooks script :
#!/bin/sh # testing server-sided hooks echo "hello" echo "cancelling push." exit 1
the push finished ok , doesn't print ...
if have ideas me welcome :)
ps : bonus question :
i did try add script did manage launch prepare-commit-msg
folder of repository in {folder}/{repo}.git/hooks
. why when clone repo local .git/hooks
doesn't contain script samples, why? (that have been easy solution make script cloned each time locally while cloning repo.
edit : formatting
Comments
Post a Comment