git hook after commit to origin

Viewed 27

How can I have a gitkraken hook run AFTER a change is pushed to the remote master?

More details: I am trying to have PARENT repo pull the latest version of PRIVATE repo on my local machine every time I push a change to the master branch of PRIVATE. I'm trying to use a gitkraken hook to accomplish this (Win10).

Right now I have a post-commit hook setup on PRIVATE which does cd PARENT && npm update PRIVATE. This isn't quite what I want because every time I push (before I commit to the remote master) the hook runs. So the hook runs before the commit to master is complete.

1 Answers

I am not aware of GitKraken hooks. From GitKraken documentation, you only have local client-side Git hooks

A hook triggered on remote side (server) after a push would be a post-receive hook, and that depend on your remote.

It also depends if you need your parent repository to be updated locally on your PC (in which case the remote needs to call you back, through a webhook).
The other approach is to execute your update on the remote server, through for instance (it depends on said remote) GitHub Actions or GitLab pipelines.

Related