开发者

Git Hooks not running automatically

开发者 https://www.devze.com 2023-02-09 20:05 出处:网络
I am trying to setup a git hook so I can integrate with bugTracker.net. They provide a git hook script which I have pasted into the post-commit.sample file for use. I have removed the .sa开发者_如何学

I am trying to setup a git hook so I can integrate with bugTracker.net. They provide a git hook script which I have pasted into the post-commit.sample file for use. I have removed the .sa开发者_如何学Pythonmple suffix so the file name is now post-commit. I have installed python and set the path. The hook however is not being automatically ran. It runs successfully if manually ran.

I have given "everybody" "full control" over the file (afaik that is window's version of chmod777)

Can somebody give me some pointers?

Thanks, Max.


I've seen this problem asked a few times over the past week or so by people trying to host a git repo on Windows so right from the start I'm almost certain what the problem is but lets run down the specifics of your setup to see.

What protocol are you using to push with? Are you using SSH, HTTP(S), FTP, RSYNC, or GIT? SSH and HTTPS are really the only two protocols that ever get used for pushing.

I am going to assume that you are using HTTP(S) because that's critical to the common scenario I keep seeing.

How did you setup HTTP(S)? Are you using the older method that is essentially just allowing HTTP(S) access to the repo and putting git-update-server-info in one of the hooks (its there in one of the default sample hooks)? Or are you using the newer method that uses git-http-backend as a CGI script?

The assumption that I am making is that you are using the older HTTP(S) method. That method was never really ment for pushing to a repo and doesn't cause the hooks to be executed. You need to switch to the newer method that uses the git-http-backend CGI script or use SSH.

0

精彩评论

暂无评论...
验证码 换一张
取 消