docs: document use_gitignore in schema reference and guide (#2957)

Co-authored-by: no-hup <shauryaj.finance@gmail.com>
This commit is contained in:
shaurya
2026-08-05 14:18:23 +05:30
committed by GitHub
parent 886d1ea650
commit f174912975
2 changed files with 39 additions and 0 deletions

View File

@@ -898,6 +898,16 @@ of the running the task is considered as a generate.
:::
::: tip
If your globs match files that are ignored by Git (build artifacts, caches,
etc.), you can set `use_gitignore: true` at the root of your Taskfile to
exclude anything matched by `.gitignore` rules from `sources` and `generates`
resolution. The setting can also be enabled or disabled per task, which takes
precedence over the root value.
:::
### Using programmatic checks to indicate a task is up to date
Alternatively, you can inform a sequence of tests as `status`. If no error is

View File

@@ -208,6 +208,17 @@ set: [errexit, nounset, pipefail]
shopt: [globstar]
```
### `use_gitignore`
- **Type**: `bool`
- **Default**: `false`
- **Description**: Exclude files matched by `.gitignore` rules when resolving
`sources` and `generates` globs for all tasks. Can be overridden per task.
```yaml
use_gitignore: true
```
## Include
Configuration for including external Taskfiles.
@@ -624,6 +635,24 @@ tasks:
- go build -o app ./cmd
```
#### `use_gitignore`
- **Type**: `bool`
- **Default**: `false`
- **Description**: Exclude files matched by `.gitignore` rules when resolving
this task's `sources` and `generates` globs. Overrides the root-level
`use_gitignore` setting.
```yaml
tasks:
build:
use_gitignore: true
sources:
- '**/*.go'
cmds:
- go build ./...
```
#### `status`
- **Type**: `[]string`