@Override
    public RegisteredService save(final RegisteredService registeredService) {
        return Unchecked.supplier(() -> {
            registeredService.assignIdIfNecessary();

            val message = "Saved changes to registered service " + registeredService.getName();
            val result = locateExistingRegisteredServiceFile(registeredService);
            result.ifPresentOrElse(file -> writeRegisteredServiceToFile(registeredService, file),
                () -> {
                    val file = registeredServiceLocators.getFirst().determine(registeredService,
                        GitRepositoryRegisteredServiceLocator.FILE_EXTENSIONS.getFirst());
                    writeRegisteredServiceToFile(registeredService, file);
                });

            invokeServiceRegistryListenerPreSave(registeredService);
            commitAndPush(message);
            load();
            return registeredService;
        }).get();
    }
This is {@link GitServiceRegistry}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-git-service-registry/src/main/java/org/apereo/cas/services/GitServiceRegistry.java