Skip to content

Instantly share code, notes, and snippets.

@sethfischer
Forked from piratecarrot/git-setup-kicad.sh
Created March 1, 2024 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethfischer/c611e5f0c8abb5c403f587d36b34048d to your computer and use it in GitHub Desktop.
Save sethfischer/c611e5f0c8abb5c403f587d36b34048d to your computer and use it in GitHub Desktop.
KiCAD git setup
#!/bin/sh
git init
cat << EOF | tee .gitignore
# For PCBs designed using KiCad: http://www.kicad-pcb.org/
# Format documentation: http://kicad-pcb.org/help/file-formats/
# Temporary files
*.000
*.bak
*.bck
*.kicad_pcb-bak
*.kicad_sch-bak
*.kicad_prl
*.sch-bak
*~
_autosave-*
*.tmp
*-save.pro
*-save.kicad_pcb
fp-info-cache
# Netlist files (exported from Eeschema)
*.net
# Autorouter files (exported from Pcbnew)
*.dsn
*.ses
# Exported BOM files
*.xml
*.csv
# Fabrication outputs
*.gbr
*.gbrjob
*.drl
*.step
EOF
cat << EOF | tee .gitattributes
*.pro filter=kicad-project
*.sch filter=kicad-schematic
EOF
git config filter.kicad-project.clean "sed -E 's/^update=.*$/update=Date/'"
git config filter.kicad-project.smudge cat
git config filter.kicad-schematic.clean "sed -E 's/#(PWR|FLG)[0-9]+/#\1?/'"
git config filter.kicad-schematic.smudge cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment