As I understand, code obfuscation is used to make reverse engineering difficult/hard for the adversaries/red team.
Now if I use a source code obfuscator where a .C/.CPP file is used as input and an obfuscated .C/.CPP file is generated, should the source code repository such as GIT/SVN store the plain text.C/.CPP file or obfuscated .C/.CPP file?
Next, if a plain text .C/.CPP file is stored in the repository, any attacker gaining access to the repository system would immediately gain access to IP-protected code or if the code was published in public github by mistake. Is that right?
In the other case, where the obfuscated .C/.CPP files are stored in the version repository system, the development team would face issues such as readability and unmanageable code. Is that correct?
So, what is the best means to protect & store the source code?