I assume that "create new branch" means (as per comments) that push to publishing repository ('publishing to project') includes new branch.
I don't know any ready solution, but it is something that can be done by post-receive
hook installed on publishing repository (on 'project'). Said hook gets on its standard input the information about successfully pushed (published) branches:
<old-value> SP <new-value> SP <ref-name> LF
When creating a new ref, <old-value>
is 40 '0
'.
So the update script would create new sub-domain (e.g. creating <branchname>.conf
file if your web server supports automatic and automatically loaded multi-file configuration) for each line which begins with 40 '0
' (which matches /^0{40}/
regexp). This script could also be used to update sub-domains, for each branch that were successfully pushed.
HTH