OneDrive File Issues

How to Exclude a OneDrive Subfolder from Sync Without Removing It Locally

Camila MilosovichCamila Milosovich Oct 28, 2026 871 views

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.

How to Exclude a OneDrive Subfolder from Sync Without Removing It Locally
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 you start

Before changing your OneDrive sync settings, ensure you have copied or moved any critical files outside the OneDrive directory to prevent accidental local deletion.

Solution 1Recommended

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.

1
Locate the folder

Open File Explorer and navigate to your local OneDrive folder where the target subfolder is currently stored.

2
Cut the target folder

Right-click the subfolder (e.g., your Git repository) that you want to exclude from synchronization and select 'Cut'.

3
Paste outside OneDrive

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

Move the Subfolder Outside the OneDrive Directory
Git Users: Storing code repositories managed by Git outside of the OneDrive folder prevents persistent synchronization conflicts and improves overall file performance.
Free Microsoft Office alternative

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. 1. Download and install: Visit the official WPS website to download and install WPS Office for free.
  2. 2. Open your files: Launch WPS Office and navigate to your local or OneDrive folders to open existing documents.
  3. 3. Edit and save: Edit your documents with advanced tools and save them in standard Microsoft Office formats securely on your device.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats.Lightweight installation that runs smoothly without heavily taxing system resources.Supports seamless saving to local directories or directly to your OneDrive sync folder.Familiar user interface makes transitioning from other office suites effortless.
microsoft office alternative - wps office

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.