How to stop Spring Cloud Config Cloning a new version of a Repo every time the Config Server is started

Viewed 34

Upon running a Spring Cloud Config application with a Git backend a clone is performed into the default location of c:/user/AppData/Temp/local/<config-repo-1>. Cloning can take a long time for larger applications (currently one of my teams takes ~15 min). When the Config Server is stopped and restarted again instead of using the same local repo another clone is performed, c:/user/AppData/Temp/local/<config-repo-2>.

Is there a way to change this behavior so that restarting the Config Server does not do a new clone but instead just does a fetch for the existing clone.

Thanks in advance for any assistance provided.

1 Answers
spring:
    config:
      server:
        git:
          clone-on-start: false

I saw this option somewhere, but couldn't figure out where I got it. Unfortunately, the official spring documentation does not refer to this option. This will not clone the rep when starting.

The other Option from the Spring Documentation is:

spring:
    config:
      server:
        git:
          force-pull: false

As documented:

... there is a force-pull property that makes Spring Cloud Config Server force pull from the remote repository if the local copy is dirty

Related