Include/exclude help

I have read the posts on include/exclude and am still confused.

First, is there a difference between i and + for including and e and - for excluding?

Second, what is the proper way to exclude files that begin with .
Unless these are needed backup files, I would like to exclude them. I want to exclude from root directory and all the subdir. Thanks. I included log below. I tried using:

exclude temporary file names

e:./?~.$

but it did not work. Thank you.

My log examples:

INFO UPLOAD_FILE Uploaded .dropbox/events/1-262f (1120)
2020-05-25 07:54:38.955 INFO UPLOAD_FILE Uploaded .dropbox/events/1-eaf8 (1584)
2020-05-25 07:54:38.955 INFO UPLOAD_FILE Uploaded .dropbox/instance1/config.dbx (136192)
2020-05-25 07:54:38.955 INFO UPLOAD_FILE Uploaded .dropbox/instance1/hy.db (57344)
2020-05-25 07:54:38.955 INFO UPLOAD_FILE Uploaded .dropbox/instance1/home.db (159744)
2020-05-25 07:54:38.955 INFO UPLOAD_FILE Uploaded .dropbox/instance1/sync/nucleus-wal (16834352)
2020-05-25 07:54:38.955 INFO UPLOAD_FILE Uploaded .dropbox/logs/1/1-80cb (5248)
2020-05-25 07:54:38.955 INFO UPLOAD_FILE Uploaded .dropbox/metrics/store.bin (558)

Yes. One is glob syntax — simple and intuitive, and the other — regular expressions. Intimidating Initially but immensely powerful.

Be careful with that, because many useful files begin with that.

So, in your case I would have excluded the Dropbox folder specifically, either with regex like so

e:\.dropbox/.*$

(You need to escape the dot because otherwise dot matches any symbols). So this will exclude e: paths that contain .dropbox Followed by / and any other symbols till the end. If you want this to only apply to paths that start with .dropbox — add ^ in front: e:^\.dropbox/.*$.

But for this trivial case glob is sufficient and easier to understand:

 -.dropbox/

You want the slash in the end to match directory. Otherwise it will try to match on a file. This will match to a directory that starts with .dropbox. And minus in the front means it’s exclusion.

To answer your question to exclude all directories starting with dot from the repository root —

-.*/

But this is too dangerous :slight_smile:

Read this for more guidance Filters/Include exclude patterns

4 Likes

saspus - thank you!
Appreciate the help.