Add entries to .gitignore
Recipe ID
org.openrewrite.AddToGitignoreArtifact
org.openrewrite:rewrite-coreAdds entries to the project's .gitignore file. If no .gitignore file exists, one will be created. Existing entries that match will not be duplicated.
Usage
You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.AddToGitignore --recipe-option "entries=*.tmp
.DS_Store
target/"If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite:rewrite-core:8.88.0Options
| Name | Type | Description |
|---|---|---|
entriesrequired | String | Multiline text containing gitignore entries to add, each on a separate line. Comments and blank lines are preserved. e.g. *.tmp
.DS_Store
target/ |
filePattern | String | A glob pattern to match .gitignore files to update. Defaults to only the root .gitignore file. Use **/.gitignore to update all .gitignore files in the repository, or specify a specific path like src/.gitignore.e.g. .gitignore |
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats