除了本地的git配置,也可以使用github或者gitee作为线上的配置中心,在Spring Cloud Config的文档中也提到了鉴权的问题(可以配置用户名和密码,也可以使用ssh来鉴权),可以参考:https://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_authentication,如果只需要测试一个github上的公共配置,可以使用如下(之前用过github作为配置中心,但是好像遇到点问题,推荐使用gitee.com作为配置中心):
spring:
cloud:
config:
server:
git:
uri: https://github.com/spring-cloud-samples/config-repo
展开