KiCad, version control and merging

One thing is basic version control. There is a lot of internet sources available to get you up to speed.

What is the VCS workflow with KiCad is another thing. As already mentioned in this thread take a look at Massaging your git for kicad.

And even when using version control with KiCad things are quite different if we are talking about one man band project or a team project.

In one man band projects, you don’t really need any special workflow. Pick files which should be under VCS and commit them (project-cache.lib should be under VCS). Until there are good diff tools available for your platform this is about it. If you feel brave enough you can integrate any of already mentioned diff solutions so you easily can compare revisions.

With team projects the main issue is eeschema libraries. There are a couple of setups that work:

  1. each team member has exactly the same libraries, in the exactly the absolute path on his/hers system and in exactly the same order. Obviously this works only if everybody has the same platform (Win, OsX, Linux distro). Even if this is the case I would not recommend this setup.

  2. each team member has exactly the same libraries, somewhere on his system and you use environment variables to resolve relative path (Environment user-defined variables: how to use them?). This is a better solution, but it requires some manual editing of .pro and .sch files.

  3. each team member has his/hers own libraries. If helps if these libraries overlap. An example of this would be official KiCad library with user appended symbols. Also using enviroment libraries like in 2. is preferred. Additionally for this setup to work you have to manually edit .pro and .sch to place the project-cache.lib on top of the library list. WARRNING: this is somewhat unsafe procedure, but if everybody is aware of this it works quite nice. How this works: when team member A puts symbol X in the schematic, the symbol is also copied to the project-cache.lib. Once team member B edits the new version of schematics, Kicad grabs the symbol from the project-cache.lib, sot team member B does note need to have the same schematic libraries. Caveats:

  • nobody ever edits the project-cache.lib
  • if you want to change symbol for one part, but there are two or more parts in schematics you have to delete the part. Create a new symbol for the part in the user libraries under a different name and place it in the schematics.

With 1. and 2. you will quickly figure out that having the libraries under VCS is a must. With 3. this is not strictly required but it helps a lot.

Disclaimer: I’ve tried 1. and 2. but I’ve quickly abondoned the setup as it caused a lot of headaches. Since then I’ve done three projects using setup 3 and they did not have any major issues.