Sharing your configuration on GitHub

I’m trying to sync my config files to GitHub but I’m stuck on the pull command.

I’ve added only the configuration.yaml file to the commit, so it should be supper small, but when I try to commit it enumerates 2078 objects and fail when trying to transfer more than 2Gb :astonished:
My configuration.yaml is quite small, so I believe this is more related to previous work, but as I’m not familiar with GitHub I couldn’t get out of this.

➜  /config git:(main) ✗ git push origin main
Enumerating objects: 2078, done.
Counting objects: 100% (2078/2078), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1997/1997), done.
error: RPC failed; curl 55 Failed sending data to the peer
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (2078/2078), 2.32 GiB | 10.28 MiB/s, done.
Total 2078 (delta 513), reused 3 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

Any clue?

I don’t really remember the specifics of what I setup but I have daily backups to GitHub automated.

It uploads everything except what is excluded using gitignore so my guess is yours is indeed trying to upload your entire directory including a large database.

Travis now has a 30-day free trial plan for the automatic configuration check.

There are a few (free) Github Action configuration checkers, I have implemented Frencks check here: homeassistant-config/config-check.yaml at 92ec7b087a14a6502c2d4123f1cd2839bfb48baf · amadeuspzs/homeassistant-config · GitHub

Did you ever found a solution?

re

ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa <<<y 2>&1 >/dev/null && cat ~/.ssh/ida_rsa.pub

shouldn’t that be id_rsa.pub rather than ida_rsa.pub ?

Re

Step 5: Your initial commit to GitHub

and specifically

You will be asked to enter your GitHub username and password
Should this be updated now that GitHub no longer accepts password authentication? As it stands, it’s waiting to trip up those following a ‘how to’ guide?

Happened to me too, did you find a solution?

Hello everyone. I had setup github upload script to upload only certain files into a private repo. I got an error yesterday saying the log file is too big. The thing is I am excluding any kind of logs to upload to github and yet I still get this

Warning: Permanently added 'github.com' (EDxxxxx) to the list of known hosts.
Enumerating objects: 445, done.
Counting objects: 100% (445/445), done.
Delta compression using up to 4 threads
Compressing objects: 100% (434/434), done.
Writing objects: 100% (445/445), 17.34 MiB | 363.00 KiB/s, done.
Total 445 (delta 283), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (283/283), done.
remote: warning: File home-assistant.log.1 is 61.24 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 68.25 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 62.71 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 61.87 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 59.40 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 51.19 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 60.31 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 60.87 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 60.77 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File home-assistant.log.1 is 63.90 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: 3d3b1566d4659df1f430b6becf8947deeb55bef6eb7ff5f87dd812c1c282f706
remote: error: See https://gh.io/lfs for more information.
remote: error: File home-assistant.log.1 is 165.87 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To github.com:username/myrepo.git'
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'github.com:username/myrepo.git'

This is my gitignore file

*
.storage
.cloud
.google.token 
home-assistant.log
.ssh
id_rsa*
.log*
.log.txt
home-assistant.log.1
home-assistant_v2.db
.ip_authenticated.yaml
secrets.yaml
custom_components
blueprints
glances
nest
tts
wyze-bridge
zones.yaml
customize.yaml
includes

I have the same issue. I hope someone can help.

One possibility?: Your .gitignore file tells git which files to ignore in the future, but if you have added them in the past manually, or if they were added before .gitignore exluded them, they will still be tracked, and you’ll need to exclude them explicitly. (E.g. with git rm).

Also, I’d probably put something like *.log* in the .gitignore , rather than listing individual files.

Adding this as much for my notes as anything else.
For anyone else struggling to convert from the old username/password to the new tokens, the answer is to remove and re-add the repository, using the git command line. This post spells out that part.

First, add a new personal access token in Github, I used these permissions:

Then, log into HA using the SSH addon.
At the command line in the config directory (the default), find your repo name with
git remote -v

You should get something like
origin [email protected]:YourUsername/YourRepositoryName.git (fetch) origin [email protected]:YourUsername/YourRepositoryName.git (push)

Remove it with
git remote remove origin
…and add it back with:
git remote add origin https://github.com/YourUsername/YourRepositoryName

Finally, trigger a push with
git push -u origin master

You should now be prompted for credentials; use your usual username, and for the password enter the new token.

Thanks to all. Anyone know if is it possible to make an automation (or schedule a cronjob) to automate git push?
In other words, how can pass username and token to git?

By(t)e