How can I backup Hassio to GitHub

Is there a way how to backup my local Hassio configuration files to GitHub?
I already have a GitHub account, but novice level user :wink:

Any help is welcome. Thanks!

Use git on your computer and point it at the folder where your config is.

It’s that simple.

Don’t forget to exclude your secrets file.

What do you mean with Git on my computer? By the way (forgot to mention that), hassio is running on Pi.

Install git on your computer.

git init in your share directory on your home assistant pi.

git remote add origin <yourgithubrepourl>

make sure you have a .gitignore that has secrets.yaml listed in it.

git add .

git commit -m "my first commit"

git push origin

3 Likes

You can use the CloudIDE hass.io add-on. It provides a terminal in which you can use the git commands (Community Hass.io Add-on: IDE, based on Cloud9)

And if all this sounds too complicated, just copy the files (or only the text) to another file and manually upload it to git. (You will need to create a git account).

1 Like

It’s probably me, but still don’t get it (sorry!), how to backup my hassio config on Pi to Github. I use a macbook as client. Is it put Git on Mac … OR fully control from the Pi. I do have a GitHub account and project:

https://github.com/username/hassio

You should probably just use the add-ons. I don’t think you’re going to really grasp how to do this without it.

Ok thanks! You mean the IDE ADD on?

Yes. As suggested by @adriaanh

Yes, just install the add-on. When you go to the IDE editor in your browser, a terminal window is available in which you can perform git commands.

1 Like

Ik got the IDE plugin installed and running

I have got this GitHub project: https://github.com/WTFoX74/hassio

Noob, what to do next? :wink:

cd config
And then use the git commands mentioned by @flamingm0e

Did you got it working?

Thanks for your interest!
I have created a .gitignore file in my config dir of hassio and it contains:

image

I ran get init on the hassio, which turns filenames into red

Running the git add . command gives me the following message

Different objects per try:

It’s probably your database. You need to include the log file and database file in your ignore or it will do that every time

Okay what is the best way to do that? and is it still a valid backup than?

?

You just add the filenames to the gitignore file.

The database is nothing more than history. It’s not needed for configuration