Ich
Ich

Reputation: 11

Call post-receive hook in git in mirorred repo

I'm using trac and I need to call post-receive hook server where trac is installed. Main repository is located in github, so I cloned github repo to local server

git clone --mirror ** **

and when I'm running

git fetch --all

I want, that git will run post-receive hook. Is it possible?

Upvotes: 1

Views: 343

Answers (1)

Seth Robertson
Seth Robertson

Reputation: 31451

The post-receive hook runs on the server when someone pushes so it. There is nothing which runs post-fetch, under the assumption that whomever run the fetch could run some other command directly afterwards (or as part of a shell script) which performs the desired action.

I was entirely unable to decipher exactly what command you wanted to run where and under what circumstance. If you are trying to keep the trac server's git repo up to date, you can ask github to send email or a tcp connection or something when it receives a commit. That email/TCP connection/etc could trigger the desired pull/fetch or whatever. Another option is to poll github every hour or whatever.

Further explanation of what you want would be good if the above is insufficient.

Upvotes: 1

Related Questions