fix bug with Git for Windows nano error

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.

Fix

Open Git Bash using “Run as Administrator” via the Windows Start menu and type into this Terminal:

dos2unix /usr/share/nano/git.nanorc

Symptom

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 \n.

Error in /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
" not understoodare/nano/git.nanorc on line 20: Command "
" not understoodare/nano/git.nanorc on line 23: Command "
" not understoodare/nano/git.nanorc on line 26: Command "
" not understoodare/nano/git.nanorc on line 33: Command "
" not understoodare/nano/git.nanorc on line 36: Command "
" not understoodare/nano/git.nanorc on line 42: Command "
" not understoodare/nano/git.nanorc on line 44: Command "
" not understoodare/nano/git.nanorc on line 47: Command "
" not understoodare/nano/git.nanorc on line 50: Command "
" not understoodare/nano/git.nanorc on line 51: Command "
Error in /usr/share/nano/git.nanorc on line 53: Regex strings must begin and end with a " character
" not understoodare/nano/git.nanorc on line 54: Command "
" not understoodare/nano/git.nanorc on line 57: Command "
" not understoodare/nano/git.nanorc on line 60: Command "
" not understoodare/nano/git.nanorc on line 74: Command "
" not understoodare/nano/git.nanorc on line 77: Command "
" not understoodare/nano/git.nanorc on line 80: Command "
Error in /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 15: Command "
Error in /usr/share/nano/git.nanorc on line 19: Regex strings must begin and end with a " character
" not understoodare/nano/git.nanorc on line 20: Command "
" not understoodare/nano/git.nanorc on line 23: Command "
" not understoodare/nano/git.nanorc on line 26: Command "
" not understoodare/nano/git.nanorc on line 33: Command "
" not understoodare/nano/git.nanorc on line 36: Command "
" not understoodare/nano/git.nanorc on line 42: Command "
" not understoodare/nano/git.nanorc on line 44: Command "
" not understoodare/nano/git.nanorc on line 47: Command "
" not understoodare/nano/git.nanorc on line 50: Command "
" not understoodare/nano/git.nanorc on line 51: Command "
" not understoodare/nano/git.nanorc on line 54: Command "
" not understoodare/nano/git.nanorc on line 57: Command "
" not understoodare/nano/git.nanorc on line 60: Command "
" not understoodare/nano/git.nanorc on line 74: Command "
" not understoodare/nano/git.nanorc on line 77: Command "
" not understoodare/nano/git.nanorc on line 80: Command "