cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

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.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: .dropbox-ignore to prevent folders being uploaded to DropBox like git's .gitignore

.dropbox-ignore to prevent folders being uploaded to DropBox like git's .gitignore

anjanesh
Helpful | Level 6
Go to solution

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.

1 Accepted Solution

Accepted Solutions
17 Replies 17

anjanesh
Helpful | Level 6
Go to solution

andresharpe
New member | Level 2
Go to solution

This might be useful for others on Windows and Powershell with the git command line tool installed.

 

The script finds all .gitignore files in current folder and subfolder and sets the ignored files and folders to not upload to Dropbox.

 

Get-ChildItem -Recurse | `
    Where-Object { $_.Name -eq '.gitignore' } | `
    ForEach-Object { `
        Write-Host $_.DirectoryName; `
        Push-Location $_.DirectoryName; `
        git status --ignored --short | `
            Where-Object { $_.StartsWith('!! ') } | `
            ForEach-Object { `
                $ignore = $_.Split(' ')[1].Trim('/'); `
                Write-Host $ignore; `
                Set-Content -Path $ignore -Stream com.dropbox.ignored -Value 1 `
            }; `
        Pop-Location }

You can paste this into say `dropbox-sync-ignore.ps1` and store in your PATH and run it whenever you start or update a project in git.

anjanesh
Helpful | Level 6
Go to solution

DropBox should come up with an update that provides this out of the box. Right now running this

xattr -w com.dropbox.ignored 1 /Users/yourname/Dropbox/workspace/react-project/node_modules

for every node project manually is a pain.

Darcey
Explorer | Level 4
Go to solution

What a solution, at least it can be done with a lot of work and command line BS...

Pathetic...

 

If you actually implemented .gitignore capabilities, you would actually get me to move away from GDrive to your services, but as is... Not a chance...

anjanesh
Helpful | Level 6
Go to solution

Yes, running that command is a tedious task. DropBox should implement a .drop-ignore setting setup like .gitignore.

denysp
Explorer | Level 4
Go to solution

Try this one:
`xattr -w com.dropbox.ignored 1 /Users/yourname/Dropbox/**/node_modules`
It should mark recursively all node module folders in your Dropbox.

Darcey
Explorer | Level 4
Go to solution

Too little too late...

DropBox also changed folder mappings after installing their desktop PC software, which took hours to fix manually.

For everyone if you want .ignore capabilities in a cloud storage solution check out pCloud, there are also software tools out there which can handle the .ignore functionality with GDrive etc. SyncBackFree or SyncBackPro will help you there. 

Don't use drop box software it will mess your windows installation up. It messes with the windows registry too much and then doesn't repair/restore it after removal.


tdriley
Explorer | Level 4
Go to solution

I got it working like denysp said, but I needed to add the -r param, so:

 

`xattr -rw com.dropbox.ignored 1 /Users/yourname/Dropbox/**/node_modules`

 

Update: Actually, both commands seem to work, but you need to run it again every time a new node_modules dir is created (eg every time you npm install a new repo), it won't ignore new ones automatically 😞

At least that's slightly better than running a new custom command for every repo. 

DevGuyWithSolutions
New member | Level 2
Go to solution

I've been copy pasting this every few days for a while and grew tired of editing the name, so to simplify:

 

`xattr -rw com.dropbox.ignored 1 ~/Dropbox/**/node_modules`

Need more support?