windows上Git bash 查看log乱码
来源:互联网 发布:淘宝靠谱美国代购 编辑:程序博客网 时间:2024/06/06 17:46
windows上Git bash 查看log乱码
设置 Git 支持 utf-8 编码
在命令行下输入以下命令:
123456
以上命令等效于:$ git config --global core.quotepath false # 显示 status 编码$ git config --global gui.encoding utf-8 # 图形界面编码$ git config --global i18n.commit.encoding utf-8 # 提交信息编码$ git config --global i18n.logoutputencoding utf-8 # 输出 log 编码$ export LESSCHARSET=utf-8# 最后一条命令是因为 git log 默认使用 less 分页,所以需要 bash 对 less 命令进行 utf-8 编码
在 etc\gitconfig 中添加
1234567
[core]quotepath = false[gui]encoding = utf-8[i18n]commitencoding = utf-8logoutputencoding = utf-8
在etc\profile 中添加
1
export LESSCHARSET=utf-8
说明:
- gui.encoding = utf-8 解决在 $ git gui 和 gitk 里中文乱码。如果发现代码中的注释显示乱码,可以设置项目根目录中.git/config文件添加12[gui]encoding = utf-8
- i18n.commitencoding = utf-8 设置 commit log 提交时使用 utf-8 编码,可避免服务器上乱码,同时与Unix上的提交保持一致!
- i18n.logoutputencoding = gbk 使得在 $ git log 时编码设置为 utf-8
export LESSCHARSET=utf-8
使得 $ git log 可以正常显示中文(配合i18n.logoutputencoding 的设置)
让 ls 命令可以显示中文名称
修改 etc\git-completion.bash 文件:
1
alias ls="ls --show-control-chars --color"
这样设置后,基本可以解决中文显示的问题。
阅读全文
0 0
- windows上Git bash 查看log乱码
- Windows下,在Git Bash中使用git log命令查看历史记录时,出现乱码的解决方法
- [git]windows下git log出现乱码
- windows下git bash 乱码的问题解决
- 解决Windows Git Bash中文乱码问题
- 解决Windows Git Bash中文乱码问题
- Windows下Git Bash中文乱码
- Windows下Git Bash中文乱码
- Windows下Git Bash中文乱码
- Windows下Git bash乱码问题
- Windows下Git Bash中文乱码
- windows下git bash中文乱码
- windows下git bash中文乱码
- windows下git bash中文乱码解决办法
- Windows下Git Bash中文乱码
- Windows下Git Bash中文乱码
- Windows下Git Bash中文乱码
- windows下git bash中文乱码解决办法
- Page的实体类
- 第三周项目4
- Zynq-Linux移植学习笔记之22-Linux应用程序调用shell脚本
- c++头文件iomanip.h中的setw、setprecision、setfill和setbase函数的使用
- 机器学习的一些注意事项
- windows上Git bash 查看log乱码
- MonoDevelop中使用 External Tools
- 深入理解 Kotlin Coroutine (一)
- bzoj 2705(欧拉函数)
- 9-22 deque, STL集锦
- Freemarker实现网页静态化
- android如何获取操作外置sd卡的权限
- 第二周三种传递方法
- uva 1395Slim Span