@Override
    public void saveOrUpdate(final SamlMetadataDocument document) {
        try {
            val repoDirectory = this.gitRepository.getRepositoryDirectory();

            val metadataFile = new File(repoDirectory, document.getName() + ".xml");
            removeFile(metadataFile);

            val signatureFile = new File(repoDirectory, document.getName() + ".pem");
            removeFile(signatureFile);

            FileUtils.writeStringToFile(metadataFile, document.getValue(), StandardCharsets.UTF_8);
            FileUtils.writeStringToFile(signatureFile, document.getSignature(), StandardCharsets.UTF_8);
            this.gitRepository.commitAll("Committed " + document.getName());
            this.gitRepository.push();
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
    }
This is {@link GitSamlRegisteredServiceMetadataResolver}.

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