Emacs: Git Commit Message with Unicode

By Xah Lee. Date: .

Emacs: Git Commit Message with Unicode, on Microsoft Windows

On Microsoft Windows, if you

git commit -m "• t3"

with unicode in it, in eshell, that bullet • become gibberish. (you can see it by git log -2)

emacs git eshell win10 commit unicode 2022-11-16
emacs git eshell win10 commit unicode 2022-11-16

to fix that:

  1. Set your coding system to utf-8. See Emacs Init: Set Default File Encoding
  2. Set emacs as editor, by git config --global core.editor emacs
  3. When commit, don't use the -m option, just git commit, it'll launch new instance of emacs, you type commit message, save the file, and quit emacs.
emacs git eshell win10 commit unicode 2022-11-16 86HF4
emacs git eshell win10 commit unicode 2022-11-16