cat <<EOF > "${PWD}"/.gitignore
# export files for BOM
*.csv
*.tsv
*.xml
# backup files
 *.bak
EOF

cat <<EOF > "${PWD}"/.gitignore
*.pro filter=kicad_project
*.sch filter=kicad_sch

EOF

git config --global filter.kicad_project.clean "sed -E 's/^update=.*$/update=Date/'"
git config --global filter.kicad_project.smudge cat

git config --global filter.kicad_sch.clean "sed -E 's/#(PWR|FLG)[0-9]+/#\1?/'"
git config --global filter.kicad_sch.smudge cat

# git archive --format=zip --output=../myproject_v1.0.zip v1.0


#cat <<EOF > ${HOME}/bin/git-imgdiff
#!/bin/bash
#PIPE=$(mktemp -u)
#(! compare -metric RMSE $2 $1 png:${PIPE} 2> /dev/null) &&  (montage -geometry +4+4 $2 $PIPE $1 png:- | display -title "$1" -)
#rm $PIPE
#
#EOF
#
#chmod +x ${HOME}/bin/git-imgdiff

#see: http://github.com/jnavila/plotkicadsch
# https://jnavila.github.io/plotkicadsch/plotgitsch_usersguide.html
