
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
- Before a Klipper/Moonraker update:
git commit -am "Pre-update" - After calibrations that
SAVE_CONFIG: commit with a message like “PID after hotend swap”
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
-
git initin the config folder - Backups/autosaves ignored
- Commit before every update and after every calibration
- Private off-device remote