33

私は最近 GitHub for Windows をインストールし、git bash プロンプトを使用しています。現在私を悩ませていることの 1 つは、LS と入力すると、すべてのディレクトリが青色で表示されることです。

git bash シェルを変更して、LS と入力したときにディレクトリが別の色で青に表示されるようにするにはどうすればよいですか?

4

4 に答える 4

56

これは特に git の問題ではなく、使用しているシェルの問題です。Git 2.9+ を使用する MINGW32 の場合:

  1. C:\Program Files\Git\etc\ bash.bashrc
# Uncomment to use the terminal colours set in DIR_COLORS        
eval "$(dircolors -b /etc/DIR_COLORS)"
  1. C:\Program Files\Git\etc\ DIR_COLORS

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.)

次の投稿も参照してください。

古いバージョンの Git では、bash_profileinGit_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'
于 2013-01-15T07:17:38.373 に答える
0

WindowsでGITを使用しようとしたことはありません...しかし、「git-config」でテキストの色を調整できるはずです。

直接編集できる (隠された?) .gitconfig ファイルもあります。

最後に、このリンクにはいくつかの良いヒントがあります。

于 2012-12-27T05:43:22.207 に答える