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
The details of the available options are as follows:
@@ -621,6 +624,44 @@ Date and time in the format `yyyy-MM-ddTHH:mm:ss` (eg `commits-before:
621
624
2015-10-23T12:23:15`) to setup an exclusion range. Effectively any commit before
622
625
`commits-before`will be ignored.
623
626
627
+
#### paths
628
+
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`:
629
+
```yaml
630
+
ignore:
631
+
paths:
632
+
- ^docs\/
633
+
```
634
+
##### *Monorepo*
635
+
This ignore config can be used to filter only those commits that belong to a specific project in a monorepo.
636
+
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`.
637
+
* Specific match on `/ProjectB/*`:
638
+
```yaml
639
+
ignore:
640
+
paths:
641
+
- `^\/ProductB\/.*`
642
+
```
643
+
* Negative lookahead on anything other than `/ProjectA/*` and `/LibraryC/*`:
644
+
```yaml
645
+
ignore:
646
+
paths:
647
+
- `^(?!\/ProductA\/|\/LibraryC\/).*`
648
+
```
649
+
A commit having changes only in `/ProjectB/*` path would be ignored. A commit having changes in the following paths wouldn't be ignored:
650
+
* `/ProductA/*`
651
+
* `/LibraryC/*`
652
+
* `/ProductA/*` and `/LibraryC/*`
653
+
* `/ProductA/*` and `/ProductB/*`
654
+
* `/LibraryC/*` and `/ProductB/*`
655
+
* `/ProductA/*` and `/ProductB/*` and `/LibraryC/*`
656
+
657
+
:::
658
+
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/`.
659
+
:::
660
+
661
+
::: {.alert .alert-warning}
662
+
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.
663
+
:::
664
+
624
665
### merge-message-formats
625
666
626
667
Custom merge message formats to enable identification of merge messages that do not
0 commit comments