Over 600,000 changes.
The other day I decided that it would be nice to store my code Projects folder under Documents on my work machine (after all, so many apps want to store their data in %UserProfle%\Documents by default).
But my company has implemented a policy that syncs that Documents folder to the cloud with OneDrive.
That's not a problem for most content, like documents. Git working directories, on the other hand...
Git uses hundreds (thousands) of files to track changes in source, combine that with the hundreds (thousands) of objects that you'll find under node_modules and other library directories and you've got a prescription for degraded performance and never-ending error messages.
You also might find a lot of files wind up missing and the file manager unresponsive.
So don't do it. Just don't. Keep your git working directories away from sync folders and preserve them the old-fashioned way: with git push
(and maybe rsync, rclone or gitbackup to local or remote block storage).
Same advice applies to Google Drive, for the same reasons.
Dustin Briles. "OneDrive and git - don't do it". Dustin Briles, 14 January 2022, https://dustinbriles.com/blog/onedrive-and-git-dont-do-it/.
Update link
https://dustinbriles.com/onedrive-and-git-dont-do-it/