# Excluded file & folder?

**URL:** <https://talk.jekyllrb.com/t/excluded-file-folder/2111>\
**Category:** Help\
**Created:** [August 27, 2018, 12:34pm UTC](https://talk.jekyllrb.com/t/excluded-file-folder/2111 "2018-08-27T12:34:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashumittal](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/yashumittal/32/1260_2.png) [@yashumittal](https://talk.jekyllrb.com/u/yashumittal)\
**Post date:** [August 27, 2018, 12:34pm UTC](https://talk.jekyllrb.com/t/excluded-file-folder/2111/1 "2018-08-27T12:34:43Z")

</div>

I have added all these files and folder to the excluded list. Is it a good idea to add `.git` folder to the excluded list?

- `Gemfile`
- `Gemfile.lock`
- `node_modules`
- `vendor/bundle/`
- `vendor/cache/`
- `vendor/gems/`
- `vendor/ruby/`
- `.git`
- `LICENSE`
- `README.md`

---

<div class="post-metadata">

**Author:** ![ckruse](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/ckruse/32/16_2.png) [@ckruse](https://talk.jekyllrb.com/u/ckruse)\
**Post date:** [August 27, 2018, 1:22pm UTC](https://talk.jekyllrb.com/t/excluded-file-folder/2111/2 "2018-08-27T13:22:38Z")

</div>

Dot files are excluded by default.

From the “include” section in the [docs](https://jekyllrb.com/docs/configuration/):

```
Include

Force inclusion of directories and/or files in the conversion.  
.htaccess is a good example since dotfiles are excluded by default.
```

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [August 27, 2018, 5:06pm UTC](https://talk.jekyllrb.com/t/excluded-file-folder/2111/3 "2018-08-27T17:06:53Z")

</div>

> [@yashumittal](#):
>
> Is it a good idea to add `.git` folder to the excluded list?

Like @ckruse mentioned, filenames starting with a dot are excluded by default. But `Jekyll::Watcher` module (that provides the `--watch` functionality) need not _ignore such files_.  
So, if changes to `.git` are being reported as being regenerated (when you run `jekyll serve` or `jekyll build --watch`), then I recommend adding `.git` to `exclude` array.

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [August 27, 2018, 5:15pm UTC](https://talk.jekyllrb.com/t/excluded-file-folder/2111/4 "2018-08-27T17:15:14Z")

</div>

I have an active proposal to modify the workings of the `exclude` array for Jekyll 4.0…  
If that PR gets merged, you’ll no longer have to lists `Gemfile`, `Gemfile.lock`, `node_modules`, … etc in your `exclude` array, they’ll be excluded, by default, automatically…

I’m not sure if `.git` and `.sass-cache` should be added to that list (to disable those dirs from being _“watched”_), or modify `jekyll-watch` plugin directly…
