How to Exclude a OneDrive Subfolder from Sync Without Removing It Locally
Question details
The user wants to stop a specific subfolder from synchronizing to OneDrive but needs to retain the folder and its contents on the local hard drive.

- Product
- OneDrive
- Device & OS
- not provided
- Scenario
- Managing local file storage and cloud synchronization, specifically to prevent local repositories (like Git) from syncing to the cloud.
- Observed behavior
- When a folder is deselected in OneDrive settings, the application removes it from the local drive and keeps it only in the cloud, offering no native 'ignore' feature.
Before changing your OneDrive sync settings, ensure you have copied or moved any critical files outside the OneDrive directory to prevent accidental local deletion.
Move the Subfolder Outside the OneDrive Directory
Since OneDrive does not support a native ignore file, the best method to keep a folder purely local is to move it entirely out of the OneDrive path.
OneDrive's folder selection feature is designed to free up local disk space by keeping unchecked folders in the cloud and removing them from your computer. To keep a folder locally but prevent it from syncing to the cloud, it must be stored outside the active OneDrive directory.
Open File Explorer and navigate to your local OneDrive folder where the target subfolder is currently stored.
Right-click the subfolder (e.g., your Git repository) that you want to exclude from synchronization and select 'Cut'.
Navigate to a completely local directory that is not managed by OneDrive (such as C:\LocalProjects), right-click in the empty space, and select 'Paste'.

Maintain Separate Local and Synchronized Folders
Organize your workspace by manually separating files that require cloud backup from those that should remain strictly local.
Enhance Your Document Management with WPS Office
While you are organizing your OneDrive files and local folders, you need a reliable office suite to handle your documents effortlessly. WPS Office offers a completely free, lightweight alternative to Microsoft Office, ensuring high compatibility and smooth offline usage.
- 1. Download and install: Visit the official WPS website to download and install WPS Office for free.
- 2. Open your files: Launch WPS Office and navigate to your local or OneDrive folders to open existing documents.
- 3. Edit and save: Edit your documents with advanced tools and save them in standard Microsoft Office formats securely on your device.

Frequently Asked Questions
Why does unchecking a folder in OneDrive settings delete it locally?
OneDrive's 'Choose folders' setting is explicitly designed to save local disk space. When you uncheck a folder, OneDrive removes the local copy to free up storage while keeping the files safe in your cloud storage.
Can I use a .gitignore style file for OneDrive?
No, OneDrive does not currently support an ignore file or a native feature to exclude specific files or subfolders while keeping them in the local synchronization directory.
How can I request an ignore feature from Microsoft?
You can submit product feedback directly to Microsoft by clicking the OneDrive icon in your system tray, selecting 'Help & Settings', and clicking 'Send feedback'.
Does WPS Office work well with local files outside of OneDrive?
Yes, WPS Office is fully capable of opening, editing, and saving files on your local hard drive completely independent of any cloud storage synchronization.




