git - 什么环境变量设置 Git Color.UI?

标签 git shell version-control

是否有一个 Git 环境变量来指示 color.ui 配置选项?它似乎不在文档中,如果有的话。

最佳答案

不幸的是,与其他一些设置不同,没有允许您覆盖 color.ui 配置选项的环境变量。

唯一的方法当然是使用命令行:git config --global color.ui true 你也可以直接编辑~/.gitconfig文件然后添加所有这些颜色选项。所有这些信息都可以找到 here .将颜色添加到您的 ~/.gitconfig 文件:

[color]
  ui = auto
[color "branch"]
  current = yellow reverse
  local = yellow
  remote = green
[color "diff"]
  meta = yellow bold
  frag = magenta bold
  old = red bold
  new = green bold
[color "status"]
  added = yellow
  changed = green
  untracked = cyan

突出差异中的空白

[color]
  ui = true
[color "diff"]
  whitespace = red reverse
[core]
  whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol

关于git - 什么环境变量设置 Git Color.UI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16676383/

相关文章:

python - 从私有(private) bitbucket 存储库 tar.gz 文件进行 pip 安装

git - 为什么这个 git clone 命令失败了?

另一个 git 存储库中的 Git 存储库

svn - 修复损坏的SVN存储库

java - 使用 Liquibase 和 Git 的推荐工作流程是什么?

bash - 将 PSQL 添加到 .bash_profile mac

linux - 无法启动脚本

linux - 启动-停止-重启 shell 脚本的功能

Google Drive 或 DropBox 上的 SVN 存储库

git 错误 : "The remote end hung up unexpectedly, invalid characters in (..path..)"