@Override
    protected SamlIdPMetadataDocument finalizeMetadataDocument(final SamlIdPMetadataDocument doc,
                                                               final Optional<SamlRegisteredService> registeredService) throws Throwable {
        val appliesTo = getAppliesToFor(registeredService);
        doc.setAppliesTo(appliesTo);
        gitRepository.commitAll("Generated metadata for " + appliesTo);

        val props = getConfigurationContext().getCasProperties().getAuthn().getSamlIdp().getMetadata().getGit();
        if (props.isPushChanges()) {
            gitRepository.push();
        }
        return super.finalizeMetadataDocument(doc, registeredService);
    }
This is {@link GitSamlIdPMetadataGenerator}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-saml-idp-metadata-git/src/main/java/org/apereo/cas/support/saml/idp/metadata/GitSamlIdPMetadataGenerator.java