kiwifs restore clones it back.
Before each push, KiwiFS fetches the remote branch and rebases local commits onto it. This avoids the routine non-fast-forward failure you’d get when another server, laptop, or teammate pushed to the same branch first.
Turn on backup sync
1
Add a backup section
.kiwi/config.toml
2
Make sure the server can push
The KiwiFS process pushes with your system
git, so it needs SSH keys or credentials for the remote.3
Start the server
Terminal
In containers, set
KIWI_BACKUP_REMOTE, KIWI_BACKUP_INTERVAL, and KIWI_BACKUP_REBASE_BEFORE_PUSH instead. They override the TOML values.
Check the last push
Terminal
Response
success is false and error holds the reason.
Push once from the CLI
Terminal
--remote, the command reads remote, branch, and rebase_before_push from [backup] in .kiwi/config.toml.
Restore from a remote
kiwifs restore clones a backup into an empty directory.
Terminal
Search indexes aren’t part of the backup. KiwiFS rebuilds them in
.kiwi/state/ when the server starts.
What happens before a push
Withrebase_before_push on, each push:
- Points a git remote named
backupat your configured URL. - Resolves the branch from
[backup].branch, then the current branch, thenmain. - Checks whether the branch exists on the remote. If it doesn’t, KiwiFS skips the rebase and the push creates it.
- Fetches
backup/<branch>. - Refuses to rebase if the worktree has uncommitted changes.
- Saves the current HEAD at
refs/kiwifs/backup-pre-rebase, then rebases local commits ontobackup/<branch>. - Pushes the branch.
- Checks that the remote branch now matches the local HEAD, and logs a warning if it doesn’t.
Troubleshooting
worktree has uncommitted changes; refusing automatic rebase
worktree has uncommitted changes; refusing automatic rebase
Commit or discard the local changes, then push again.
Terminal
Rebase conflict
Rebase conflict
Two writers changed the same lines. Resolve the conflicted markdown files with normal git tools.Run
Terminal
git rebase --abort to give up and return to the pre-rebase state.Recover the pre-rebase HEAD
Recover the pre-rebase HEAD
Terminal
Related
Versioning
How every write becomes a commit.
Docker
Configure backup with environment variables.