PCB file gets corrupted during git merge

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