在windows中打開git bash
git config --global i18n.commitencoding utf-8 設置提交日志使用utf-8
git config --global i18n.logoutputencoding utf-8 設置輸出日志時使用utf-8
export LESSCHARSET=utf-8 設置LESS字符集為utf-8
輸入這三個命令之后,在git bash中中文亂碼問題基本解決。
在powershell中的中文亂碼問題解決方法
LESSCHARSET=utf-8 設置環境變量,將變量“LESSCHARSET”的值設置為utf-8
git config --global core.quotepath false 解決中文路徑亂碼問題
使用gitk或者git gui界面,查看更改前后的不同時也會有亂碼。
git config --global gui.encoding utf-8 解決圖形界面亂碼問題