Create, upload, and share
Find help to solve issues with creating, uploading, and sharing files and folders in Dropbox. Get support and advice from the Dropbox Community.
Just like we have .gitignore for preventing files / folders to be uploaded to github, it would be nice to have the same for DropBox.
I have a workspace folder with tons of node_modules folders.
I want to upload the workspace folder to my DropBox but want to skip the node_modules folders.
Is there a way to achive this by making some .dropbox-ignore entry in my workspace's folders ?
That would be really helpful. Thanks.
pCloud has this feature, save yourself some time and just get 2TB on pCloud for life during a sale. Just add node_modules etc etc inside their software client.
https://stackoverflow.com/a/72978599/126833
In case you want to get all of the node_modules that you want to delete in a shell file :
find . -name node_modules -type d -print0 | xargs -0 stat -f "rm -rf %N" > rm_node_modules.sh
Then in terminal run
bash rm_node_modules.sh
pCloud has this feature, this has been a dropbox request for years, don't waste your time.
Hello!
This will not be an ideal solution for everyone but I find it useful. I am using windows 11 and this works well for me, I basically just use it on my node.js projects' node_modules directory to stop all that junk from being synced.
The end result, you can see the node_modules folder is now being ignored:
You will need to modify the registry and store some powershell script files somewhere on your system where they won't be moved or deleted etc. You could even store them in your dropbox if you wanted! If you are not comfortable doing this then you will have to find a different solution.
There are 4 files to make, 1 registry file and 1 powershell script file for adding the ignore and another 1 of each to remove the ignore, if you wish.
If you are comfortable using regedit, you could forego creating the registry files in favour of manually creating the keys and values, but I'll leave that up to you.
Yes, all those backslash characters (\) are necessary, and if you change the path to your powershell scripts, be sure to put two backslashes to represent a directory separator as it must be "escaped" (the backslash character is used to tell the system that the character following it is a literal character and not an escape character, so we have to use two there, and four in the actual powershell path).
To use these, simply create the files as shown below and then run the .reg files to insert the values into the registry, or create the keys and values manually if you prefer. Once you've done that, the commands should show up in your explorer shell context menus when you right click upon a folder. In Windows 11, you will likely have to choose the "Show More Options" menu item at the bottom of the context menu in order to see the new commands.
Registry File: dropbox ignore command.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\dropbox_ignore]
@="&Dropbox Ignore"
[HKEY_CLASSES_ROOT\Directory\shell\dropbox_ignore\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -File \"C:\\powershell scripts\\dropbox\\dropboxignore.ps1\" \"%L\""
Powershell Script: dropboxignore.ps1
$path = $args[0]
Set-Content -Path $path -Stream com.dropbox.ignored -Value 1
Registry File: dropbox stop ignore command.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\dropbox_stop_ignoring]
@="&Dropbox Stop Ignoring"
[HKEY_CLASSES_ROOT\Directory\shell\dropbox_stop_ignoring\command]
@="C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -File \"C:\\powershell scripts\\dropbox\\dropboxignore-remove.ps1\" \"%L\""
Powershell Script: dropboxignore-remove.ps1
$path = $args[0]
Clear-Content -Path $path -Stream com.dropbox.ignored
I hope this helps some people, until Dropbox finally just adds their own command to the context menu and/or support for ignore files.
Happy syncing!
For users of Linux, I've made a utility that synchronizes the Dropbox ignore settings to your .gitignore. It's very fast, leveraging the transitive nature of the ignore attribute. https://gist.github.com/coder0xff/ca41728fd55b0f74dd970ff46972cdbb
Are there "Dropbox ignore settings"? Only on Linux?
Synching Dropbox ignore settings to .gitignore would be nice, but I'd be thrilled to have any way to have Dropbox ignore specify files or file types.
The settings I'm referring to are the com.dropbox.ignored extended attribute that can be set on a per-file and per-directory basis. They can be set manually using the attr command. My script automates setting or clearing the attribute based on .gitignore. See https://help.dropbox.com/sync/ignored-files
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!