3D Printing

Version your Klipper config with Git (and never lose a tuned printer.cfg)

Five minutes of Git setup turns every config change, SAVE_CONFIG, and update into a diff you can review and undo.

2026-10-20
Illustration: Version your Klipper config with Git (and never lose a tuned printer.cfg)
Original illustration by SafeToUpdate (CC BY 4.0).

Your Klipper config holds hours of tuning: rotation distances, PID values, input shaper, probe offsets, macros. Git gives you history and an undo button for all of it.

1. Initialise a repo in the config folder

On most current installs the config lives in ~/printer_data/config:

cd ~/printer_data/config
git init
git add -A
git commit -m "Baseline config"

2. Ignore the noise

Klipper’s SAVE_CONFIG writes the auto-generated section at the bottom of printer.cfg and keeps timestamped backup copies (printer-YYYYMMDD_HHMMSS.cfg). Moonraker also writes backup files. Keep them out of history:

printer-*.cfg
*.bak
.moonraker.conf.bak

3. Commit before and after every change

git diff then shows exactly what changed. That’s especially useful after reading Klipper’s Config_Changes.

4. Split config with [include]

Klipper supports [include filename.cfg] (and globs) — see the Config Reference. Keeping macros, hardware, and tuning in separate files makes diffs much easier to read.

5. Push somewhere off the Pi

Add a private remote (GitHub, Gitea/Forgejo on your homelab) and git push. SD cards fail; your config shouldn’t go with them. Don’t commit secrets. Moonraker API keys and webhook URLs belong in a separate, ignored file.

Checklist

📬 The Weekend Patch Report

One email a week: what's safe to update, what will bite, and one practical tip for your homelab or printer.

Free, weekly, unsubscribe anytime.