You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/input/docs/reference/mdsource/configuration.source.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,6 +225,44 @@ Date and time in the format `yyyy-MM-ddTHH:mm:ss` (eg `commits-before:
225
225
2015-10-23T12:23:15`) to setup an exclusion range. Effectively any commit before
226
226
`commits-before`will be ignored.
227
227
228
+
#### paths
229
+
A sequence of regular expressions that represent paths in the repository. Commits that modify these paths will be excluded from version calculations. For example, to filter out commits that belong to `docs`:
230
+
```yaml
231
+
ignore:
232
+
paths:
233
+
- ^docs\/
234
+
```
235
+
##### *Monorepo*
236
+
This ignore config can be used to filter only those commits that belong to a specific project in a monorepo.
237
+
As an example, consider a monorepo consisting of subdirectories for `ProjectA`, `ProjectB` and a shared `LibraryC`. For GitVersion to consider only commits that are part of `projectA` and shared library `LibraryC`, a regex that matches all paths except those starting with `ProjectA` or `LibraryC` can be used. Either one of the following configs would filter out `ProjectB`.
238
+
* Specific match on `/ProjectB/*`:
239
+
```yaml
240
+
ignore:
241
+
paths:
242
+
- `^\/ProductB\/.*`
243
+
```
244
+
* Negative lookahead on anything other than `/ProjectA/*` and `/LibraryC/*`:
245
+
```yaml
246
+
ignore:
247
+
paths:
248
+
- `^(?!\/ProductA\/|\/LibraryC\/).*`
249
+
```
250
+
A commit having changes only in `/ProjectB/*` path would be ignored. A commit having changes in the following paths wouldn't be ignored:
251
+
* `/ProductA/*`
252
+
* `/LibraryC/*`
253
+
* `/ProductA/*` and `/LibraryC/*`
254
+
* `/ProductA/*` and `/ProductB/*`
255
+
* `/LibraryC/*` and `/ProductB/*`
256
+
* `/ProductA/*` and `/ProductB/*` and `/LibraryC/*`
257
+
258
+
:::
259
+
Note: The `ignore.paths` configuration is case-sensitive. This can lead to unexpected behavior on case-insensitive file systems, such as Windows. To ensure consistent matching regardless of case, you can prefix your regular expressions with the case-insensitive flag `(?i)`. For example, `(?i)^docs\/` will match both `docs/` and `Docs/`.
260
+
:::
261
+
262
+
::: {.alert .alert-warning}
263
+
A commit is ignored by the `ignore.paths` configuration only if **all paths** changed in that commit match one or more of the specified regular expressions. If a path in a commit does not match any one of the ignore patterns, that commit will be included in version calculations.
264
+
:::
265
+
228
266
### merge-message-formats
229
267
230
268
Custom merge message formats to enable identification of merge messages that do not
0 commit comments