Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Ignore Certain Files

Not long ago I decided to move all of my Exercism exercises onto Dropbox for easier access.

I have have been making progress in the JavaScript, Rust and Go tracks.

Is synchronized everything but it took a very long time.

Today I fell over this Tweet from @brianwisti

First remove node_modules. *Then* cp -Rv the project folder.

It struck me that I had all of the node_modules directory structures, which was completely unnecessary, since I just wanted the code.

Luckily I found out via StackOverflow that I was not the only one with that problem and it was actually possible to possible to ignore files in Dropbox using extended attributes.

So in order to ignore the node_modules I need to do the following:

xattr -w com.dropbox.ignored 1 node_modules

I can then list the attributes:

xattr -l node_modules
com.dropbox.ignored: 1

I can remove the ignore flag again:

xattr -d com.dropbox.ignored node_modules

And no attributes are set or at least not my com.dropbox.ignored extended attribute

xattr -l node_modules

Resources and References