zoukankan      html  css  js  c++  java
  • Git for windows 中文乱码解决方案

    1.git status时显示乱码,如下:

    316304261276316304265265.txt
     解决方案:
    $ git config --global core.quotepath false
    

    2.git bash中输入中文显示乱码,如下:

    锘夸腑鏂囨枃妗£
     解决方案:

    编辑 C:Gitetcinputrc 文件中对应的行,查找以下2行,并修改其值,
    原先:

    set output-meta off
    set convert-meta on

    改为:

    set output-meta on
    set convert-meta off
    

      

    3.使用git log查看含有中文的log信息时显示乱码,如下:
    <E4><BF><AE><E6><94><B9><E6><96><87><E6><9C><AC><E6><96><87><E6><A1><A3>
    

    解决方案:

    在Bash提示符下输入:

    $ git config --global i18n.commitencoding utf-8
    $ git config --global i18n.logoutputencoding gbk

    注:设置 commit 提交时使用 utf-8 编码,可避免 Linux 服务器上乱码;同时设置在执行 git log 时将 utf-8 编码转换成 gbk 编码,以解决乱码问题。
    编辑 C:Gitetcprofile 文件,添加如下一行:

        export LESSCHARSET=utf-8
    

    注:以使git log可以正常显示中文(需要配合:i18n.logoutputencoding gbk

    4.使用ls命令查看含有中文的文件名乱码,如下
    ????.txt
    ???????.md
    

    解决方案:

    使用 ls --show-control-chars 命令来强制使用控制台字符编码显示文件名,即可查看中文文件名。
    为了方便使用,可以编辑 C:Gitetcgit-completion.bash 文件,添加如下一行:

     alias ls="ls --show-control-chars"
    

     

  • 相关阅读:
    xUtils 中的BitmapUtils 全面注释
    321影音代码
    android studio使用技巧
    java android面试题分析总结
    android面试题分析总结
    据说年薪30万的Android程序员必须知道的帖子
    好用软件
    win10找回win7的windows照片查看器
    github上传代码
    android 常见错误集锦
  • 原文地址:https://www.cnblogs.com/ayseeing/p/4203679.html
Copyright © 2011-2022 走看看