How to version control kicad with google drive

Hi,
I thought i had the perfect setup. My entire project is on google drive and from there i can work in kicad. Everyday i copy the working folder into a version as a backup(a bit silly i know, but since google drive controls every single file its hard to go back in time on all the files).

Now i open the folder on a other computer and try to continue working on the project and all my symbols in the schematic are ’ broken’. (This schematic was made using older symbol libraries which may break the schematic. Some symbols may need to be linked to a different symbol name. Some symbols may need to be “rescued” (copied and renamed) into a new library. The following changes are recommended to update the project. )

Kicad for me has been a journey with many ups and downs. Sometimes i felt that i completely understood everything and then i got a reality check with something that wasn’t easy to use, especially if you are not a programmer.

Right now i have everything as a global library, which means that if i export the working folder it does not contain the proper libraries, even though i do have folders there.

I want to switch to project specific libraries but right now i have a massive project where i use a global library and i am afraid to switch, if i mess it up its going to take me hours. I always thought that my libraries where saved in the working folder but they weren’t, they where still in the place where i made my first project.

Sorry, this is an incoherent mess but i hope someone can help me get on track. I want to work from google drive. The project needs to be fully useable from google drive, meaning that if i use an other computer i can continue working on the project. It doesnt need strict version control since i am the only one working on the project, i just want to switch between my home computer and work computer.

Can i copy the current global library into my working folder (named libraries), and set the footprint and schematic libraries as project specific with that location? If i would to that now, will it break everything?

What happens when you archive the project? Does it store every library in the folder and make it project specific?

Hope someone can help me out a bit, i feel that this is the last part i haven’t fully figured out yet and i am afraid to mess it up so close to the end:P

The contradiction is in your title. Google drive is not a version control tool! It is a cloud service. SVN, git, … are version control tools.


Having global libs does not violate being able to share or version control a project. You just need to have the same global lib setup at all the machines where you intent to work on.

As long as you include the cache lib you are even able to view the project in any state on any machine without thinking about global libs at all. (Worst case you need to rescue the schematic before viewing. Not a problem for pure viewing but would be annoying if you make changes.)


Without proper version control you will need to keep global libs rather stable as you otherwise will get into trouble when you want to continue working on a project you finished half a year ago. (One of the reasons why version 4 to version 5 migration is rather hard is because we reorganized the full official library.)
Especially with regards to 3d models.

With version control this is less as an issue. One then needs to have the version of the lib linked to the project in some way. In git this can be done via submodules. Checking out some state of the project will then ensure the global lib is at the state it was when the project was last committed. (renaming global libs is still an issue as it will mean that your lib table is out of sync with the lib at an older state -> so either avoid it or have the lib table somehow liked to the version of the global lib. The later would require a script)


More details: Library management in KiCad version 5


Project local libs have their place but not for generic parts. I would argue it is worse having one version of the SOIC-14 footprint in every project probably in a slightly different state than it is having to deal with setting up global libs on all intended machines. It also will make it harder to track which version of a symbol/footprint pair for a given component is the most recent one.

1 Like

Thank you Rene for the quick reply, you have quite often helped me out before. In your post is a lot of information so its gonna take me a while to work through it. I already use SVN but it also has problems and since i dont work with other people on the same project i thought it would be easier just to work in the cloud. I dont fully understand everything yet but i am going to try to learn from the post you made!

It might sound really naive but wouldn’t it be great if you just have a folder in your project with all the libraries you used. When you open a project in that folder Kicad will automatically recognize that folder and use it. If you want to add footprints or schematics you can add them via the footprint or schematic editor, and that will place them in that folder.

This is possible by adding your local libs to the local lib tables. It comes with the massive downside of splitting your lib. So what you gain now with reduced effort in setting up a proper global lib will be paid by future you when you want to start reusing parts of different projects. (or when you reuse the same broken asset for the third time because you could not remember which project had the corrected one and which the broken one.)


By the way this is why i kind of like the lib table stuff. It makes sure that one does not save that much work with a bad setup compared to a well organized one. I think it kind of forces users early on to properly think about library organization and therefore avoids them getting to an unsalvageable state in the first place.

1 Like

Bummer, the whole library system is more complex then i thought. If i do version control with svn, keep all the folders on svn including the library, is that then a sustainable solution? Would i then make a specific folder on SVN(not in a project folder) with the libraries. Then i would make another folder with the project i am working on. Then on every computer i use kicad i would point to the library folder on SVN and then work in the project folder? I am correct in this? Thanks for your patience!

If you put your personal global libraries on google drive as well and then on each computer link to those libraries computer’s local path to that google drive folder with the same library names then each computer should be able to access the same version of your personal global libraries the same way. This should hopefully cut down on having to rescue each project as you move from computer to computer.

To make things a little easier for library management, you can use the KiCad Environment Variables (see the Configure Paths menu item) to give the same name to each computer’s unique path to the library folder on google drive. What I then did was copy my global fp-lib-table and sym-lib-table to my cloud drive (I use dropbox, but I don’t see why google drive or oneDrive shouldn’t also work) from %APPDATA%\kicad. And then in %APPDATA%\kicad on each computer I use mklink in the command line to create a file link (different than a shortcut) to the respective files. It’s a bit of an advanced technique (really helps to be comfortable in the command line), but helps keep my library tables synchronized across computers so when I add, remove, or change a library it happens on all the computers.

Watch out for library caching (I’m not talking about each projects cache library…). When you start KiCad on computer A and the library contents are loaded into memory, if you then make changes to that library on computer B, you may run into weird behavior. Try to make a habit of only using KiCad on one computer at a time.

The problem with using google drive instead of a proper version control tool is that you have no way of accessing an older version of the lib if you want to access an older version of the project (there is no way to link versions of one file to versions of other files. with svn or git the full repo can be checked out at the state of the project you want to work on)

From the viewpoint of handling kicad setup i would say it does not matter how you make your version control or sharing as long as the system looks like a normal file system. (local git and svn clones fulfil this requirement)

Heh… Yeah, I had ignored that whole “version control” aspect. I was just writing about how I share resources between different computers. Sorry I didn’t make that clear. :wink:

For the moment libs are treated equal to code inside git repositories. Probably this is not the most comfortable attempt and CI/CD automation is designed for executable code rather than library data. Maybe there are some Kicad users lurking around here with experience of NoSQL databases like MongoDB ? This is file oriented database for colaborative maintenance and use, distributed to any number of servers wether they are public, company intranet or local to the machine. As far as I know Ebay and Amazon rely on this.

For EDA use I dont see the need to access old lib versions (unlike code to merge diffrent branches) if local version of all used components are held inside design (and are in the backup with the design) Updates of existing designs to later lib versions makes only sense on demand for selected components to avoid destroying the design. Converting designs between incompatible formats is always a mess
.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.