PCB file gets corrupted during git merge

Hi,

I use git to maintain all my kicad projects. Whenever I want to do a design change, I just make a new git branch and start making changes, and then later on merge it with the main.

The problem I faced is that when the merge happened, the .kicad_pcb file and the bak file were both changed in such a way that it could not be opened.

The error message read “Missing ( at line 8, in the .kicad_pcb file”.

I have two questions,

  1. Do people use git to maintain kicad projects?
  2. How do I merge branches locally using git on the current kicad project without corrupting the main files?

By quick reading I don’t yet understand your use case, but have you read Tools for cooperation?

It was discussed here before several times.
KICAD files are not meant for GIT based version control, and you can’t easily and selectively merge changes between files.

1 Like

Thanks for pointing out to the tools for cooperation thread. It clears out my query.

Oh thanks for the info.

I saw that you mentioned it here. Thanks for the clarification again.

To be exact, they are good for git or other version control, but not for merging, only branching and versioning.

2 Likes

So basically we can use git tagging, and making branches for various versions of the project.

But never merging, as the CAD files are never made for merging(diff files) or for distributed development.

Yes. Branching is good, keeping the history is good, tagging is good. Merging within files can succeed only accidentally. Merging is of course OK if the distributed changes are made to different files, say, one person modifies one hierarchical schematic sheet and another one modifies another; or one modifies the schematic and another one meanwhile modifies the layout.

1 Like

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