And to make the troubleshooting easier, I would install the OS onto an external drive, boot from that and mount your "problem" drive to ignore permissions and see if rsync or something will let you get the files into a cleaner state.

We use Git over SMB with SourceTree to build our websites (convenient to share the same database and files), since we upgraded to OS X El Capitan the file permissions are not the same and Git marks every files changed as their perms switched from 0664 to 0775 (or 0644 to 0755). For example, here is the ls -la output using SSH on our dev server What's with the @ symbol in permi… - Apple Community Nov 08, 2007 Mac OS X 10.10.3 'Staff' File Permissions Solutions

Chmod Mac Os X - dirtysoft

Verify and Repair Permissions from the Command Line in OS The helpfulness of verifying and repairing file permissions in OS X is debatable, and in OS X El Capitan, Apple’s removed the option from Disk Utility altogether, favoring repairing permissions Default permissions set by the system - IBM

The ins and outs of an OS X Permissions fix | Macworld

File group permissions constantly displaying 'Fetching In OS X, permissions work by user and group identification numbers being associated with files in the filesystem index, and when you access the file the system looks up these identification Terminal Permission Denied on OS X | Your Business Terminal Permission Denied on OS X. If you are a more advanced Mac owner, then you probably know the Mac OS X Terminal application. However, the inner workings of a Mac can bemuse even the most tech-savvy user. File permissions, for example, can confound you when denying access to seemingly innocuous files. By