Git Backup - out of sync

Started by bucker00, August 02, 2025, 12:26:32 AM

Previous topic - Next topic
So it seems Google backups aren't a thing anymore so I set up Git backup which worked great.  For 8 commits.
I haven't changed anything at the Git end but Opnsense seems to think there are changes at that end that it won't overwrite.
The following is in the system log:


git-backup git out of sync (To ssh://... ! [rejected] master -> master (fetch first) error: failed to push some refs to 'ssh://github.com/...'; hint: Updates were rejected because the remote contains work that you do not hint: have locally. This is usually caused by another repository pushing to hint: the same ref. If you want to integrate the remote changes, use hint: 'git pull' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I certainly have got better things to do than edit files on github and the repo is private which i checked 88 times when I set it up.
Anyone know if this will just happen again if I somehow delete the config backup so it can start again, or a better way to fix this?

This might happen if the remote Git repository got changes or if you restore a config ... 
To fix this, ssh into the instance, `cd /conf/backup/git/` and do a force push. `sudo git push origin main --force`. Maybe you branch name is not `main`. Maybe `master`? 
And keep in mind that the current git backup will be overwritten with what's the current state of your opnsense.