Git 2.24.1.windows.2 seems to have a bug in git.nanorc within Git Bash.
Specifically, the wrong (Windows/DOS)
\r\n line endings seem to have been introduced.
A simple fix is to use
dos2unix to correct the line endings.
Open Git Bash using “Run as Administrator” via the Windows Start menu and type into this Terminal:
Git operations using the “nano” editor, such as
git commit without the
-m option or
git rebase -i invoke errors as below.
This is despite the git.nanorc matching templates as old as 2016.
The problem is, in Git 2.24.1.windows.2, the line endings were accidentally set to DOS
\r\n instead of
/usr/share/nano/git.nanorc on line 1: Regex strings must begin and end with a " character " not understoodare/nano/git.nanorc on line 2: Command " " not understoodare/nano/git.nanorc on line 10: Command " " not understoodare/nano/git.nanorc on line 15: Command " Error in /usr/share/nano/git.nanorc on line 19: Regex strings must begin and end with a " character