This library package owes a lot of thanks to DevTank. It is heavely inspired by their kicad common https://github.com/devtank-ltd/kicad_devtank_common.
The following guide describes my current procedure to set up a new project in KiCAD which will allow source version control in a git repository and on-demand access to my updated libraries.
The following steps provide a wholly controlled source method for starting a new Kicad project whilst allowing shared use and collaboration of the Devtank libraries.
Create git controlled folder for new project and add common Kicad libraries.
(go to the folder where you want to store your projects, eg. cd Projects)
mkdir my_new_project
cd my_new_project
git init
git submodule add [email protected]:PhilipMcGaw/kicad_template_common.git common
This step creates a file used by git to filter out unneccesary files being archived.
echo "# export files for BOM
*.tsv
# backup files
*.bak
*.bck
*.kicad_pcb-bak
*.kicad_sch-bak
*/*-backups/*.zip
~*" > .gitignore
git add .gitignore
git commit -a -m "Setup common libraries for my Kicad project."
It is worth copying the files fp-lib-table
and sym-lib-table
into the root project folder as this will cause changes in the library to be updated in your project.
If you want a slightly easier path… you can make use of my kicad template; navigate to the KiCad documents folder:
- Mac: ''~/Documents/KiCad/7.0/template/''
- Windows:
- Linux:
git clone ssh [email protected]/PhilipMcGaw/kicad_template
Create a new Kicad project from common template.
To checkout an existing project afresh do:
git clone --recursive ssh.devtank.co.uk:/git/my_new_kicad_project
cd my_new_kicad_project
git submodule init
git submodule update
(You may want to do this if for example another user has a project under development and they are pushing changes to the server. You will need to pull down the latest files using the folllowing commands.)
git pull
git submodule update
(This should only be done if you want to update an existing project with the latest Devtank libaries or the project is still under development. If you just want to view an existing project then then this step is not required.)
git submodule sync
# Open Kicad do anything required.
git commit -a -m "Updated to latest common libraries for feature foobar."
To commit local changes to the project do:
(Note: Your push maybe refused if you have made changes to a version older than in the remote git repository. If multiple people are working on a project, best pull often or work on separate branches. If after the fact, you must do a rebase or merge and resolve the differences.)
(This includes changing the version of the common libraries used as done above.)
git add * # Make sure any new files are added.
git commit -a -m "My changes to my project."
git push # Push changes to central repo.*
To commit local changes to the common libraries, do:
(The following steps push local changes to the master (server) git repository. They should be done in the order below, e.g. common libraries first and then project files if you are baselining an entire project. If you want to push library changes so that other users can see them then you only need to follow the steps for common library updates.)
(Note: Your push may be refused if you have made changes to a version older than the one in the remote git repository. If multiple people work on a project, it is best to pull often or work on separate branches. If after the fact, you must do a rebase or merge and resolve the differences.)
(Note: the git push command pushes the local changes to the master server version so that others can access the changes and use them.)
cd common
git add * # Make sure any new files are added.
git commit -a -m "What are my changes to the common libraries?"
git push # Push changes to the central repo.
- Sick of Beige PCB footprints.