Github Config Sync — Home Assistant config sync to GitHub

Hey Everyone

I’ve been looking for a Home Assistant app that can sync my configuration folder to GitHub in a straightforward way, and I couldn’t find one that did exactly what I wanted, so I built one with the help of my new best friend GitHub Copilot.

Github Config Sync is a Home Assistant app and custom integration that lets you:

  • log in to GitHub using Device Flow

  • choose an existing repo or create a new one

  • sync your Home Assistant config folder to GitHub

  • run dry runs before pushing

  • do a Clean Upload when you want to re-upload everything

  • manage .gitignore recommendations for common Home Assistant files

  • see live sync progress, token status, and diagnostics in the UI

It supports private repositories too, as long as the token has access to the repo/branch you choose.

What it’s for

  • keeping a GitHub copy of your HA config

  • making it easier to back up and track changes

  • avoiding manual git work on the HA host

  • syncing from a simple app UI instead of the command line

How to install

  1. Add this repository as a Home Assistant app repository:

https://github.com/MJP-76/GithubConfigSync

  1. Install Github Config Sync from the app store.

  2. Open the app UI.

  3. Click Start Device Login and approve GitHub access.

  4. Select an existing repository or create a new one.

  5. Run Dry Run first, then Run Sync Now or Clean Upload when ready.

Notes

  • A full rebuild/reinstall may be needed after releases if the UI looks stale.

  • The app is designed to be Home Assistant-friendly and uses common ignore defaults like secrets.yaml, .storage/, .cloud/, ip_bans.yaml, and known_devices.yaml.

  • It also provides a diagnostics download to help troubleshoot.

If anyone wants to give feedback, I’d love to hear what works, what doesn’t, and what else would make it more useful for HA users.

Matthew

  • Finding a link to even use your software was kind of challenging. No listed links in this post at all, just something I found in text form. I suggest using the MyLink facility provided by Home Assistant and add other links to your GitHub.
  • Your text has used the term Add-on throughout this post and your GitHub. Add-ons have been renamed to Apps many months ago now. Using the term Add-on with new software can cause some confusion because people have been trying to find add-on in the HA UI, and it is no longer there. Please consider a wording revision.
  • The level to which you allowed something or someone, I assume the AI, write the readme and this post without you checking and testing what is here makes me VERY wary about trying to use this software at all.

Distributing software without proper attribution is not a good idea. Perhaps a credit section with attribution to any help you got and base software sources (including AI) would be appreciated.

This got my alarm bells ringing.

Does your best friend store your (often unencrypted or easily extracted) HomeAssistant security and access attributes somewhere where others can find them?
How can you (and more importantly, us) be so sure it doesn't?
As HomeAssistant ducks and weaves, everchanging (often on a weekly basis), will your app keep pace, carefully watching for potential security leaks? Will it let you know if it does find any? How?

One reason why I made sure it follows the strict rules using .gitignore

However if you put things into other config files then you have the ability to ignore them or add to your own .gitignore

So it does not backup logs, databases or secrets files

Also why by default I made the repo it creates as private

If you share your repo, it will always be YOUR responsibility to confirm YOU are not sharing anything personal

I will be using this myself as it’s something I have been looking for for a long time

Thanks for making others aware of these important security issues.

Aren’t they the very files you need safely tucked away ready to recover for when disaster strikes? The ones nefarious third party wannabe hackers would love to get their hands on, and often siphon up for later analysis. The ones your private access better be robustly unbreakable for, especially for later, smarter AI versions that will come along and be able to eat existing encryption algorithms for breakfast.

Are the restore processes robustly tested as well? Yes, in time of disaster recovery we can rebuild a fresh install fairly easily, but can I get all my data back is the question everybody will ask.

Where did your coding AI friend source their training wisdom from? Publicly available source code, which even you say does not do the job you need, hence your valuable contribution to fill the gap. Will it slurp this up and use it, along with other sources, to wisely co-assist you improve the next iteration? If so, will your access mechanisms to existing backups be backward compatible so you can retrieve them, many backup generations later?

If they are involved, where do you store your encryption, decryption, and access tokens for data retrieval? Yet another robust location?

These are challenges every backup scheme attempts to solve. Some do it badly, as you have pointed out, and we eagerly look forward to a robust, well tested, and ever evolving and improving solution for what is a very important tool to prevent data loss.

Thanks for the comments

I am not seeing this as a “backup” or “disaster recovery” for home assistant as there is already one baked into home assistant

That being said, someone may come along and add the ability

The aim was to be able to “copy/sync” my current config to a github private repository so I can track changes to my config overtime and if I need to go back and revert a specific automation for example then I have an easy to access, private, off site repository of the last x number of days

In all honestly, I am on the verge of pulling this and making it private use only

I appreciate you sharing this, and I will use it. I’ve needed this several times in the past year when things got deleted or changed and I wanted them back… restoring the backup and pulling out the code manually was a pain.

Please keep this available. Even though some posts/people may try to poke holes, usually some are genuine inquiries and even might help build a positive outcome for your effort. Take it in stride, its going to me a minority of people with those comments/thoughts – most of us will benefit from your work!

Lots of work gone into the add-on recently, anyone willing to take a look?

Any issue please raise an issue via the issue tracke on the repository

hey bud, I have not yet had time to try it… I should have time this week.

No worries, even more changes have been done and think most of the bugs are ironed out

Such an app is long awaited, not only by myself, so thanks for spending time on that… Currently I use git on the command line but would be happy to try this app.

So I had a quick lock into the code, not really diving in. While only looking for obvious things from a helicopter view - I need to admit that especially the design decision to exclude files / folders (see hashing.py for instance) is a bad idea generally. Instead of a black list I would design such an app with only a white list. By default, don’t commit / push anything, except what’s allowed. You would miss so many things on a black list that other users (but not you) have got.

I am not yet sure - needs a deeper review - if folders, like include_ssl (stores the private keys) and include_addon_configs (could store MQTT passwords etc) would be pushed to github with default app settings. And be assured, users will use such an app with default settings.

For now, I won’t use it with that black listing strategy. Would rethink the situation if instead a white list is the source for what’s being published on github.

Maybe you could explain some of your major design decisions. That would definitely help.

Cheers!

Thanks for the feedback — you’re right, a deny-by-default (whitelist) approach is safer. I’ll change the default to upload nothing unless explicitly allowed, with a UI to select files/folders.

Existing users will be prompted to review/migrate their config. The heuristic scan stays as a safety net, not the primary control.

I have generated an issue on the repo to track this

Matthew

Git command line is remarkably difficult to use. I use GitHub Desktop for Windows to manage my repositories and it’s much more intuitive than the Git command line.

20+ years exclusively on Linux… And yes there are nice graphical tools that I prefer, like KDevelop, in which I write code and sometimes commit/push to github directly. But command line is easy as well.

Anyway, an App to select the content and push on button press, especially within home assistant would suit me well for sure. Because I rarely use my laptop for ha tasks but my phone, even for adjusting my configs, scripts etc…

Cheers!