As I understand, code obfuscation is used to make reverse engineering difficult/hard for the adversaries/red-team.

Now If I use source code obfuscator where-in say a .C/.CPP file is used as input and an obfuscated .C/.CPP 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 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([https://www.securityweek.com/toyota-discloses-data-breach-impacting-source-code-customer-email-addresses][1]). Isn't it? 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. Isn't it? 

So what is the best means to protect & store the source code?
 


  [1]: https://www.securityweek.com/toyota-discloses-data-breach-impacting-source-code-customer-email-addresses