I am using Spring Config to share in a git server the configuration for some Spring Boot microservices.
It works great but when I am traveling I have to work offline sometimes.
I have configured Spring Config microservice local profile to get the config from my local git, (file:) and not to be HTTP git server, so I can change config and test without needing access to main git server.
The problem is that as I am not able to do a "git push" to push the change to main repository, Spring Confgig notes it and shows this message:
The local repository is dirty or ahead of origin. Resetting it to origin/master.
and resets it deleting my last local commit with last config changes.
How can I make Spring Config just to get the last committed configuration in my local git ignoring if it is pushed or not to the main server?
I had a similar problem. (the difference is that I am not using Spring Config microservice, but runnging spring configuration server as a stand alone application)
But this should work for you as well: Instead of launching local configuration server with a local git repository (file:) I have launched it with native spring profile.
spring:
profiles:
active: native
cloud:
config:
server:
native:
searchLocations: file:///path/to/local/git/repository
So now content of local repository is served and no reset is done on access
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With