Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active July 18, 2024 07:51
Show Gist options
  • Save plembo/ff6839d9593ec8afca0ba97d890cce58 to your computer and use it in GitHub Desktop.
Save plembo/ff6839d9593ec8afca0ba97d890cce58 to your computer and use it in GitHub Desktop.
Never put git working dir on OneDrive

Never put a git working directory on OneDrive (or Google Drive)

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/.

@SCHOUTER
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment