I have a big private repository which is maintained on a local network. I'd like to automatically push a subtree of that repository outside of that network. I need it to be simple:
*Task* someone pushes to local remote repository --> a subtree is automatically pushed to some other repository
I am not sure if this could be achieved with a server side hook because AFAIK there is no such thing as pushing subtrees from bare remotes. I came up with two ideas:
- I could clone the remote on the server and automatically split the subtree in the cloned remote. This doesn't really help because I don't know how to auto-pull the subtree (others also have this problem).
- Another idea is to write a custom client-side
post-commit-hook
and make every user install it, but this is terrible, isn't it? Git book specifically states that policies should be enforced on server side.
Is there a simple way of achieving something like this? Or is this impossible and it's just git abuse?