I have one remote repository and two remote repos in two different systems.
In one system, I will modify and push the code to a remote repo.
How can I update the code in another local repo automatically using git hooks?
I have one remote repository and two remote repos in two different systems.
In one system, I will modify and push the code to a remote repo.
How can I update the code in another local repo automatically using git hooks?
If you have one local repo pushing to a remote repo, and want a second remote repo to be updated, you need to set a post-update
hook in the first remote repo (as in this answer for instance)
ssh git@firstRemoteRepoServer
cd /path/to/remote/repoA.git/hooks (#bare repository)
git remote add B /url/to/remote/bare/repoB.git
echo "git push --mirror B" > post-receive
chmod 755 post-receive