GIT中文亂碼問題解決

  1. 打開git bash, 使用ls命令查看當前目錄下的文件,中文顯示成亂碼。html

    GIT中文亂碼問題解決

  2. 進入git安裝目錄。git

    GIT中文亂碼問題解決

  3. etc\gitconfig文件中增長如下內容:windows

    [gui]     encoding = utf-8bash

    [i18n]     commitencoding = gbk svn

    [svn]     pathnameencoding = gbk工具

    GIT中文亂碼問題解決

  4. etc\git-completion.bash文件中增長如下內容:ui

    alias ls='ls --show-control-chars --color=auto'spa

    說明:使得在 Git Bash 中輸入 ls 命令,能夠正常顯示中文文件名。htm

    GIT中文亂碼問題解決

  5. etc\inputrc文件中增長如下內容:utf-8

    set output-meta on set convert-meta off

    說明:使得在 Git Bash 中能夠正常輸入中文,好比中文的 commit log。

    GIT中文亂碼問題解決

  6. 在windows下能夠使用tortoise git這個可視化工具比較方便,這樣就不會出現bash下的亂碼問題了。

    GIT中文亂碼問題解決

相關文章
相關標籤/搜索