I’m trying to exclude my zones.yaml, but it keeps getting uploaded. This is my first time dealing with this. I can delete it of course, but it still in the history,
secrets and known_devices dont get uploaded, but zones.yaml does.
Also if you can tell me an easy way to remove it from history that would be great too. Otherwise I’ll get the ignore file working, and just delete and start over since I just started.
is zones.yaml in your root directory? For your .gitignore just add the files you want to ignore. if you must just manually each file you want to upload.
thanks, that did it. Also just to be safe before I did it this time, Just went ahead and added all my zone info (lat/long) to my secrets file anyway. I had it in my configuration.yaml too.
and my git repository has all the yaml files (other than the excluded) and one folder “Packages”. I dont have a scenes folder locally, so that’s not there. coming soon.
I now want to include a folder that already exists. How would I do that. I think I understand now, that if I add a new file or folder, it will be added automatically, but anything exisiting when I did my first commit wont.
Sorry to keep bugging you. Now that I’ve finally set this up, I see how awesome it can and will be.
But also possible for a NOOB like me to erase things (I accidentlly deleted my zones.yaml locally when trying to figure out things, haha), so my question is now about pulls
If I modify a file on github, and then do a pull from my HA server, will it only update the files that are in the repoistiry that have changed, and leave the other files alone. Like lets say I have a file that I never added, would it just get ignored, or would it be deleted because it was not in the repoistiry. I guess the same question for folders, etc
Your repository keeps up with what is local and what is remote. If the file never existed in the repository at all git doesn’t even notice it. Push and pulls only update staged/commited files. If you’ve changed a file but haven’t added it or staged it then it will just sit there until you tell git that you want to update it. If you ever want to see what changes you’ve made you can do a quick git diff to see what you’re edited locally that hasn’t been pushed to the repository.
I’m still very new to git myself. I pretty much just use it for the basic backup function and a place to store some arduino code. There’s a lot that it can do that I don’t even understand myself.
As stated above a gitignore is for files to ignore. Starting the file with ‘ignore everything’ and then trying to add stuff back is counterintuitive and bound to lead to complications later down the line.
I’m new so I don’t know. I “think” that the intent was to reduce the chance of any username/passwords, sh scripts, or anything else in your HA install from being inadvertently uploaded by noob;s like me.
The example would backup everything needed for the average HA install to be recovered. And I guess that is what the article was really focusing on.
But yea, it only took a few times to realize that it was not enough for me.
How do you determine the files that need to be ignored?
I get secrets.yaml but what about OZW_Log.txt or pyozw.sqlite, etc
Is there a comprehensive list of “unsafe” files to commit?
Also are there files that if you don’t backup then the backup will NOT restore your system. For example will pyozw.sqlite rebuild or is that need in the backup?
Looking at the Cookbook examples of peoples github commits they all seem to ignore different things.
This example excludes a huge list of things.
I just want a backup that will work but of course don’t want to save unsafe items.