windows下git bash中文亂碼解決辦法


git bash下中文亂碼解決辦法:

一.解決辦法1:(直接上圖)

1.在git bash下,右鍵 出現下圖,選擇options:

2.選擇“Text”

3.將“Character set”設置為  UTF-8

 

二.解決辦法2:(在上述辦法1中,如果在git  bash中,右鍵沒有菜單的情況下)

進入git安裝目錄,通常是C:\Program Files (x86)\Git\

1. 編輯etc\gitconfig文件,在文件末尾增加以下內容:

[plain] view plain copy
[gui]  
    encoding = utf-8  #代碼庫統一使用utf-8  
[i18n]  
    commitencoding = utf-8  #log編碼  
[svn]  
    pathnameencoding = utf-8  #支持中文路徑  

2. 編輯etc\git-completion.bash文件,在文件末尾增加以下內容:

[plain] view plain copy
 在CODE上查看代碼片派生到我的代碼片
alias ls='ls --show-control-chars --color=auto'  #ls能夠正常顯示中文  


3. 編輯etc\inputrc文件,修改output-meta和convert-meta屬性值:

[plain] view plain copy
 在CODE上查看代碼片派生到我的代碼片
set output-meta on  #bash可以正常輸入中文  
set convert-meta off  


4. 編輯profile文件,在文件末尾添加如下內容:

[plain] view plain copy
 在CODE上查看代碼片派生到我的代碼片
export LESSHARESET=utf-8  

 

原博主:https://blog.csdn.net/u013068377/article/details/52168434


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM