git add 报错UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xaf in position 42 问题 git add 报错UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xaf in position 42。 解决 可以在每次使用 Git 时显式指定编码: git config --global i18n.logoutputencoding utf-8