Creating a Git repository as configuration storage

Let's create a Git repository in this example:

$ cd $HOME 
$ mkdir app-config-repo 
$ cd app-config-repo 
$ git init . 
$ echo 'user.role=Dev' > application-dev.properties 
$ echo 'user.role=Admin' > application-prod.properties 
$ git add . 
$ git commit -m 'Initial commit for application properties' 

As you can see, you can add multiple configuration files depending on your requirements.

Remember, using the local filesystem for your Git repository is intended for testing only. Use a server to host your configuration repositories in production.

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.