Guide

Git with KiCad: what works and what doesn't

Git is the most capable free version control you can put under a KiCad project, and KiCad 9 and 10 have it built into the project manager. It is also a tool made for source code, so it is worth knowing exactly where it fits a PCB project and where it doesn't.

Last reviewed

What works well

  • KiCad's schematic (.kicad_sch), board (.kicad_pcb) and project (.kicad_pro) files are plain text, so Git stores their history compactly and can show line diffs and blame.
  • Commit messages record why a change was made, which no backup or cloud folder does.
  • Branches let you try a layout change without touching the version you sent to fab.
  • Tags mark released revisions, so the exact files behind “Rev B” are one checkout away.
  • KiCad 9 and 10 can commit, push, pull and switch branches from the project manager, so you rarely leave the editor.
  • Any remote works: GitHub, GitLab, a self-hosted Forgejo or Gitea, or a bare repository on a drive.

What to commit

File or folderCommit it?Why
.kicad_proYesProject settings: design rules, net classes, text variables.
.kicad_sch (every sheet)YesThe schematic. Hierarchical sheets are separate files; commit them all.
.kicad_pcbYesThe board.
sym-lib-table, fp-lib-tableYesThe project's library tables, so others resolve the same libraries.
Project-local symbol and footprint librariesYesKeep the parts the design uses inside the repository (see libraries below).
3D models the board referencesYes, ideally with Git LFSWithout them the 3D view and STEP export break for everyone else.
.kicad_prlNoPer-user view settings: visible layers, open sheets. Changes on every session.
fp-info-cacheNoA footprint cache KiCad rebuilds.
*-backups/ and .history/NoKiCad's own backups. KiCad's docs advise excluding .history when you use Git.
Lock files (~*.lck) and _autosave-* filesNoTemporary files KiCad writes while a file is open.
Gerbers, drill files, BOMs, PDFsYour choiceEither commit them for each release (tagged), or generate them in CI so they always match the source.

A .gitignore for KiCad projects

Start from GitHub's maintained KiCad template and add your project's outputs if you build them in CI. A minimal version covering the files above:

.gitignore
# KiCad temporary and per-user files
*.kicad_prl
fp-info-cache
*-backups/
.history/
~*.lck
_autosave-*
*.bak

# Generated outputs, if CI builds them
# gerbers/
# *.zip

Check the template against your KiCad version: file names have changed between major releases. GitHub's KiCad.gitignore is linked at the end of this page.

Libraries and 3D models

The most common way a KiCad repository breaks on someone else's machine is a part that lives in a global library on the designer's computer. Git only versions what is in the repository.

  • Keep a project-local symbol and footprint library for every part you created or changed, and point the project's sym-lib-table and fp-lib-table at it with ${KIPRJMOD} paths.
  • Reference 3D models with paths relative to the project, or through a path variable everyone defines the same way.
  • Store large binary models with Git LFS so clones stay fast.
  • Before a release, open a fresh clone on another machine and check the schematic, board and 3D view load with no missing parts.

Where text diffs stop helping

A line diff of a KiCad file is accurate but rarely readable. Moving one footprint changes its coordinates and every pad's; refilling a zone can rewrite thousands of lines; re-annotating touches every reference designator. Nothing in the diff shows you the drawing.

  • Visual diff tools close most of the gap: KiRI (KiCad Revision Inspector) and KiCad-Diff render schematics and board layers for two commits side by side.
  • CI such as KiBot can plot PDFs, Gerbers and BOMs on every commit, so reviewers can open files instead of reading S-expressions.
  • Neither is built into GitHub or GitLab: you install them, keep them compatible with your KiCad version and run them yourself or in CI.

Branches and merging

Branches work well for trying things. Merging is where Git and KiCad part ways: two branches that both changed the same .kicad_pcb are merged as text, conflicts are common, and a merge Git reports as clean can still leave a board that fails DRC.

  • Agree who edits the board file at a time; split work across schematic sheets where you can.
  • Rebase or merge small, frequent changes rather than long-lived board branches.
  • After any merge that touched a board file, open it in KiCad and run ERC and DRC before you commit.

Judged fairly

Git on a code host with visual diff tooling is the right answer for open-source hardware and for engineers who already review firmware in pull requests. Plain Git with text diffs is a solid free history for a solo maker. Where it breaks down is review by people without KiCad and Git, and merging parallel edits to one board. See the full ranking for how it scores against purpose-built options.

Sources