Noob Alert - Setting up GitHub repos for libraries on PC

Hello Folks -

I’m a brand new KiCad user and also have never used Git before. I also am using this on a 64 bit PC.
I have bumbled my way into d/l git desktop for the PC, and have set up 4 Kicad folders in a separate place for the symbol, footprint and 3d shape libraries along with the templates. After about 5 gig of downloading, it looks like it all worked and the stuff is there. Now then, a couple of rather basic questions due to my ignorance on these things …

  1. As soon as I set this all up, I decided I really should have placed the cloned repos in another location on my computer ! I am unsure how to go about this. Can I just move the folders, and then go into the git desktop program and change the link there ? I have not been able to figure this out, but again, I am so new to all this it might be staring me in the face.

  2. When I want to “refresh” the cloned libraries on my machine, I see there is a button in gitdesktop called “fetch origin” once I have selected what library is active. Is this the way to refresh a library ? I clicked one and it said “refreshing” briefly, but nothing else happened - then again I only set it up 10 minutes ago - haha. Do changes that have taken place pop up when there are changes ?

  3. I noticed the sym-lib-table and fp-lib-table in each of the symbol and footprint repositories. Is the normal procedure to just copy that over the existing tables in the roaming\kicad folder on my pc after each refresh of these libraries to capture the new files that may have appeared since last time? i.e. to save the process of doing it manually within Preferences>Manage Symbol libraries and Preferences>Manage FootPrint Libraries ?

Thanks for the help and apologies for the very basic questions. I had another thread going on here with some issues that had appeared due to me d/l KiCad 4 some time ago, never using it, and then recently d/l 5.0.2 and starting to learn the software, but that’s all sorted out now (I think).

Cheers,
Lewis

Firstly, by 64 bit PC do you mean specifically a 64 bit Windows OS based computer, or simply a generic 64 bit Personal Computer? IOW, what is your OS?

I’m really also a neophyte regarding git, but I’ve done a similar thing with cloning the repositories to my machine. Don’t forget to change your paths in KiCad to point to the cloned repositories instead of the libraries in the installation folder. But, I’m not confident that I’m doing git “correctly”. I look forward to answers from people more comfortable using git, and more specifically the GitHib Desktop app.

To answer your question, you could do this (copying the library tables from the local repository to the KiCad settings folder), but what if you have added some personal libraries to your global library tables. Simply copying the library table files will nuke the settings for your custom libraries.

What I do is make sure my personal libraries are at the top of the tables. Then right before copying the library table files into my settings folder I make a copy of my existing global tables. I then use a text diff to see what the changes are (I use PSPad, I’m sure Notepad++ and other programmer’s text editors will also do text diff) to help highlight my custom library entries. I copy the lines for my libraries over, and take note of what has changed in the actual table so I can satisfy my curiosity to see what was added. (Recently a new symbol library for cryptography chips was added.) Because this is a highly manual process, I don’t refresh my local repositories often. By making the copy of the tables right before I pull in the new tables from the refreshed repositories, this catches any personal libraries that I may have added between repository updates without me needing to keep a separate file maintained.

1 Like

Sorry about that - its a 64 bit Windows machine.

Hmmm…never thought about the personal libraries that are in the tables, and I will most certainly have at least one of them once I get going. I understand your manual approach but lack of experience precludes me from offering or coming up with anything better, so perhaps others will chime in here eventually. It sounds like a workable solution though.

This is all pretty slick the more I learn about how KiCad works and organizes things. Once I have the github sync’d libraries set up in the sym/fp tables, is there any reason for me to keep the libraries that have been d/l as part of the KiCad installation I wonder? I mean, will it break something if I just go in and delete them from the program files\Kicad\share… folders ? Looks to be almost 5 gig of stuff in there at the moment…

Thanks for the tips.

Silly me, I didn’t notice that it was you. Windows computer based on the previous thread.

Thinking about it, one could probably come up with a script that not only uses the git commands to refresh the local repository but also updates the library table settings. Maybe a program flow of the library table could be, load the active library table and delete all lines that have ${KISYSMOD} or ${KICAD_SYMBOL_DIR} (depending on which library table is open) and then insert the library lines from the repository table.

(Inspiration is on how kidneys work. They filter all sorts of stuff out of the blood, and then reabsorbs what it knows are good things. That way they don’t need to know everything that is bad, only what is good.)

1 Like

Yes. If you use some git frontend UI application you may have to open that new location.

Generally you use fetch only if you need to get a new branch from the remote origin which you don’t already have. Otherwise you just check out the wanted branch (“master” is usually the default for main development and the one checked out by default) and “pull”.

That’s a good way to do it. Otherwise you have to manually add possible new libraries.

1 Like

I didn’t think of that, I use the global tables only for the standard library. You could integrate the new changes to your personal global tables also with some diff/merge application. They just require some learning first.

1 Like

Most of it is 3d models. But you can delete the KiCad libraries which were installed by the installer. You can always re-install them if you need them for some reason.

1 Like

Just a note for anyone that’s as unskilled as me and reading this (not sure how that could be possible but anyway…)

I tried just blindly moving the local repositories from one place to another on my PC and the github desktop program fired up “repo not found” when it was started, but gave the option to navigate to the new folder where I placed it, so all is well now. Convenient when shuffling things around.

I think I have the hidden folder “.git” visible when I did that so there’s no loss of anything in the movement process. I know almost zero about git so sorry if this is all obvious to people…

Cheers,
Lewis

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