I don't observe the problem in upstream grep, so quite possibly this is a
packaging issue in Git for Windows. I suggest reporting the bug there.
- bug#31182: Grep Not Matching with Caret in First Line of... Budin, Clay
- bug#31182: Grep Not Matching with Caret in First Li... Paul Eggert
- bug#31182: Grep Not Matching with Caret in Firs... Jim Meyering
- bug#31182: Grep Not Matching with Caret in First Li... Benno Schulenberg