How to make Dropbox "ignore" specific folders in the sync

I tried using Dropbox to sync my computer's code files, however it syncs everything. I want to be able to configure Dropbox not to sync folders with specific names like ".git" and/or "target" as target folders get generated automatically and gets huge as the development goes.

Is there a way to configure Dropbox to ignore some folders (auto generated or not)?


Solution 1:

Starting early 2020 you can actually exclude files and directories from sync.

Under Linux the command is:

attr -s com.dropbox.ignored -V 1 /path/to/somewhere

Under macOS the command is about same:

xattr -w com.dropbox.ignored 1 /path/to/somewhere

For the command under Windows see another answer, or:

Set-Content -Path C:\Users\yourname\Dropbox\Example -Stream com.dropbox.ignored -Value 1

Solution 2:

execute in powershell:

Set-Content -Path /path/to/ignored/file -Stream com.dropbox.ignored -Value 1

see: How to set a Dropbox file to be ignored | Dropbox Help

Solution 3:

Yes, this is called Selective Sync in Dropbox.

You can exclude specific folders being synced with DropBox.

In Windows 7 and Dropbox 3.1.265, you can:

  • click on Dropbox system tray icon
  • click on gear icon and select Preferences
  • click Account
  • click Selective Sync
  • Untick the folder you no longer wish to sync with Dropbox
  • Click OK

Be warned that Dropbox will delete that folder, so make sure to copy everything to another place before you do this and copy it back afterwards. (Thiago Duarte)

Solution 4:

  1. Copy those folders to another location which isn't synced with Dropbox.
  2. Use selective sync to unsync the original folders (Dropbox will delete them).
  3. Copy the backed up folders to the original location again (They will remain unsynced.)

Source: https://www.dropboxwiki.com/tips-and-tricks/exclude-folders-from-syncing

PS: I agree with the comments below. There seems to have been some change in behaviour in Dropbox's sync function which creates selective sync conflicts. If you are facing this issue, I found yet another alternative - I moved my folders containing large files out of Dropbox and rather put their links (shortcuts) in the desired locations. This syncs them as files and not folders.