Large .git files in backup under data/.git

For months now my backups were over 5GB. Now they are over 8GB. I finally took the time to check the file size in the backup. Files in the data/.git folder add up to over 8GB.


I’m sure I have done something stupid. I did install the GitHub addon recently, and I have been using VSC for years with a Git backup. I don’t really need the backup on Git as I use both Samba Backup and Google Drive Backup too.

Just to be clear, I first unzipped the backup into a folder and then ran
tar -ztvf * > files_size.txt
I then loaded the text file into Excel and extracted all folder levels of the file name. I then created a pivot table summing the file sizes by folder level. The folder names are those supplied by the tar command.

the largest folder by far is data/.git/objects.

Two questions:

  • If I uninstall both VSC and GitHub, can I just delete the data/.git files?
  • How do I get to the data/.git files?

I’m more confused than ever. I deleted both the GitHub and VSC add-ons and then rebooted. Straight after the reboot I opened Terminal. When I navigated to the homeassistant folder I got a Git prompt. Is this expected behaviour?

The what?

I never heard of a github add-on. Please post a link.

Sorry, it is GitHub integration:

My issue is the very large data/.git files.

If I have deleted both the GitHub integration and the VSC addon can I delete the data/.git files?

I can see the files using File Editor.

Unless you are a Home Assistant developer needing to monitor pulls and issues from your project git, I fail to see any benefit from a GitHub integration. I could be, and often am wrong, but I don’t get it.

I am not a complete novice to GitHub. I do a lot of work using Arduino sketches and use Github Desktop to maintain my repositories.

This is my understanding… The git files are a pull from your repository and you can safely delete them from your local disk. Delete the integratoin or the next time you start Home Assistant, the integration will just do another pull.

Do a full backup first.

I am still scratching my head to see the use of a Github Integration. Please enlighten me.

I made a backup, deleted the entire data/.git folder, rebooted (successfully), did a backup, and the backups have shrunk from over 8GB to 200MB.

I was trying to backup my configuration files to GitHub.

More work than it’s worth.

I am fairly certain that except for the database, everything in the config folder is a text file. A backup is simply a tar (compressed) file of the files in the config folder.

I do a nightly backup of my config using the Samba Backup add-on. It’s rare that I need to restore from a backup, but that is always because I have screwed something up so badly that taking two steps backwards is the best recovery. I think there are other backup add-ons using Google, but I haven’t used them yet.

I DO use Github Desktop to archive my ESPHome projects that I want to memorialize for future reference… Mostly experiments, things to try, etc. But not from inside Home Assistant.

If you haven’t already, the Samba Share add-on is a must-have addition to Home Assistant. You can then open the Home Assistant folders using File Explorer just like any other folder.

Yes, I do, thanks. I use Samba Backup and Google Drive Backup. :nerd_face: