我最近安装了 Windows 版 GitHub,并且正在使用 git bash 提示符 - 现在困扰我的一件事是,当我输入 LS 时,所有目录都以蓝色列出。
如何更改我的 git bash shell,以便当我输入 LS 时,目录以不同的颜色列出为蓝色?
这并不是具体的 git 问题,而是您正在使用的 shell 的问题。在 MINGW32 上使用 Git 2.9+:
- C:\Program Files\Git\etc\bash.bashrc
# Uncomment to use the terminal colours set in DIR_COLORS
eval "$(dircolors -b /etc/DIR_COLORS)"
- C:\Program Files\Git\etc\目录颜色
DIR 01;37 # Attribute=bold; Text color=white
DIR_COLORS 文件:
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#NORMAL 00 # no color code at all
#FILE 00 # regular file: use no color at all
RESET 0 # reset to "normal" color
DIR 01;37 # directory
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
另请参阅以下帖子:
- http://linux-sxs.org/housekeeping/lscolors.html http://linux-sxs.org/housekeeping/lscolors.html
- http://www.kernel.org/doc/man-pages/online/pages/man5/dir_colors.5.html http://www.kernel.org/doc/man-pages/online/pages/man5/dir_colors.5.html
- http://linux.about.com/library/cmd/blcmdl1_dircolors.htm http://linux.about.com/library/cmd/blcmdl1_dircolors.htm
对于旧版本的 Git,bash_profile
in Git_Installation\etc
文件夹的颜色发生变化:
LS_COLORS='di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90'
export LS_COLORS
alias ls='ls -F --color --show-control-chars'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)