0

I'm trying to create a post-push hook for git. The objective is just to run a shell command to launch gitrob once the code has been pushed to Github. I found this : https://stackoverflow.com/a/3812238/9709330 But I'm a noob Linux user and when I saved my post-push hook as 'git-push-wh' in /usr/local/bin (which is in my $PATH), it didn't change anything and when I run git push-wh it is not recognized.

Any help ? Or any other way to do this ? Thanks :)

1 Answers1

0

One thought is to add the function to your ~/.bashrc or ~/.zshrc that way your shell has access to the function and you can simply call the function in the shell just by the function name. After adding the function to either of these files you'll need to tell your shell to update as well, source ~/.bashrc will do the trick.

example from my ~/.bashrc:

function test() {
   echo "yo"
}

then I ran the source ~/.bashrc and now in my shell:

bash-3.2$ test
yo

I hope this helps!

Rob Nordberg
  • 55
  • 1
  • 3
  • 6