I cannot find any hook that is invoked from repository B (executes bash script on B) if I do a push from B to remote repo C. I want to take some action after push - I want to cd
to another bare repo A on same machine as B is and do fetch from remote C. I can write a script wrapping git push, cd, git fetch but ideally I would like to execute cd, fetch from hook.
I am in B ( A and B are on same machine, I work in B and do push to remote C, A is tracking C so I want to cd into it and fetch/reset C into bare A)
executed in B repo:
#!bin/sh
git push
echo "updating A repository"
cd /A/project.git && git fetch origin master:master && git reset --soft
Can I put this code to some hook in B repository so it will be called automatically always after I do push to remote repository and remote repository is updated?