Use a file to ignore / exclude files or folder
Add functionality similar to a gitIgnore file or nomedia files. Allow a user to add a .ignore file to exclude local files or folders from being synced.
Example: I have NodeJS projects on my OneDrive but get sync errors because the file path is too long. The long paths are primarily extra modules that do not need to be synced. It would be nice to be able to exclude certain folders or files.
Hi, for this scenario we’d recommend putting the files outside of the OneDrive folder. The design is that all files in the OneDrive folder will be sync’d and files outside the folder will not be sync’d.
Fernando Rocha commented
we need this ASAP
very good request and a mustl. I'm suprised and annoyed that it is still not implemented
I've found that the best solution is creating a 'local' folder outside the OneDrive folder where the project will be saved and any modules will be installed. This is the actual project.
To sync it to OneDrive I manually create a 'parallel' folder and copy only the content I want using 'RoboCopy'. You can then schedule this task.
The files & folders names/wildcards to ignore were copied from the .gitignore file
The solution is based on a few articles:
[Schedule RoboCopy task and simple examples]
[RoboCopy documentation by Microsoft]
you can also use GUI to create the .bat task file to be scheduled. [GUI by microsoft] & [ChoEazyCopy GUI which is much better]
Harold Gale commented
Some applications don't allow users to save to other folders by default.
I don't need 2GB worth of files every 2 hours only to delete them when I get back to my desk
Most of my team stopped using OneDrive because of this problem
'not right now' was 2015, surely someone's groomed their backlogs enough by now to be able to implement this fairly simple feature (it's just client-side file filtering, folks.)
a) node/npm folks typically need a crazy 10,000+ files to make things work and don't provide a clean way to move local node_modules elsewhere (outside a synced folder).
b) onedrive folks say we will not support exclusion of certain local folders à la .gitignore. Btw. from what I have just read no different for dropbox and googledrive :-(.
Both sides have been insisting on their point of view for years, despite an obvious need and many user requests. Bravo! Ingenious engineers at both ends.
Most workarounds seem to indeed put node based projects outside synced folders and fiddle around with a secondary local sync software to bring selected stuff back to the online synced folders. Exciting modern technology.
+1 - No need to sync node_modules!
Putting files outside of the OneDrive folder is sometimes just not possible. Build a node.js project and you know, what I mean. I do not want to waste my OnerDrive space for node_modules. And global install also does not work. Then there are also files created in the node_modules folder. Have you heard of the file: .gitignore?
+1 this feature is pretty crucial.
I'd love to use OneDrive to sync my projects to the cloud for backup and accessing on other machines -- but as soon as I run `npm install`, then I have a bloated `node_modules` directory that starts syncing.
And try working on more than one project? All of the sudden you have 5-10 different bloated `node_modules` folders all trying to sync, throwing sync errors, slowing down the machine, and ruining my day.
I need to be able to .onedriveignore files/directories. It would be really nice if OneDrive would ignore anything listed in .gitignore files by default, and then additional ignoring could be added in a .onedriveignore file.
"Just don't sync your projects to OneDrive" is bad advice coming from Microsoft. Should we use the OneDrive product or not?
Omg. Still not possible? So node_modules are synced. What a mess. So I assume, the developers do not use OneDrive themselves.
need to exclude .git
Sokunthet Sok commented
If Microsoft's actual recommendation is to simply use another folder, then OneDrive needs to be opt-in only on Windows 10. It is quite frankly asinine to push users to sync their documents to OneDrive when OneDrive is completely incapable of handling temporary files and other side-effects of IDEs (including Visual Studio).
Why would voting be closed on something like this?
+1 for me as well. Really needed for software development work and more.
Disapointed Again commented
Horrible recommendation. I need one subfolder (bin/) ignored so I can sync the rest of the files and folders in parent folder.
"putting the files outside" is not a reasonable recommendation.
Oh, MS, your answers are always ****.