First of all, check whether the branch to be read is correct in the configuration. Starting from a few months in 2020, the master branch on github has become the mian branch. Therefore, the configuration of the read branch in yml should be:label: main
Secondly, if yml uses uri: [email protected]:springcloud-config.git this ssh connection, other configurations are required, so I gave up this method for configuration and adoptedConfigure via http/https. It is worth noting that if you use http and https methods, you need to add a password and user name in the configuration file if you do not configure the password-free configuration.
The detailed case is as follows
server:
port: 3344
spring:
application:
name: cloud-config-center #注册进Eureka服务器的微服务名
cloud:
config:
server:
git:
####仓库地址
uri: https://github.com/wang692/springcloud-config.git #GitHub上面的git仓库名字
####搜索目录,即仓库名
search-paths:
- springcloud-config
####读取分支,main即代表springcloud-config仓库的master分支
label: main