How to install configuration files from git repo

There are numerous examples of Home Assistant implementations stored in git repos.

I’d like to do the same with my configuration so that I can simply install from the repo every time I rebuild my HA server, which is quite often as I have a Development and Production version and I essentially want to use the same configuration files (configuration.yaml, automations.yaml, etc.) across two Home Assistant instances.

The problem is that the automation files contain device_ids, which vary from installation to installation and seems to be tripping me up. Similar with backups, I don’t seem to be able to move a backup from one machine to another without masses of issues.

I’m not sure if I’m getting too far into the installation process before deploying the git managed config files.

So the question is really: how do you use config files from a git repo with a fresh installation of Home Assistant?

If it makes any difference this is a supervised install on Debian Bookworm.

Thank you.

1 Like

You may have multiple use cases. One is tweaking and testing automations in the dev system before deploying to the prod system. The second is backup and restore. If you are using Haos the only practical solution is to use the built in backup and restore.

If you include .storage in git, that’s where all the integration config, device ids, etc, are stored. This is an essential part of your config. So if you copy the storage directory also, those device ids will start working.

That said, get rid of the device ids. You’ll want to be able to look at an automation diff in git and see exactly what changes. Much easier when you have human readable entities ids.

1 Like