Share repository settings?

Is it possible to share, or export in some way, all the settings for a repository so that they can be used elsewhere?

It’s a pain having to set up webhooks, branch permissions, environments etc for each repository when it’s mainly all the same settings being applied.

I’ve tried using one as a “template repository” but that only shares the files and not the settings.

This is for Enterprise version