# git色彩显示

在 `~/.gitconfig` 中添加以下段落

```
[color]
  diff = auto
  status = auto
  branch = auto
  interactive = auto
  ui = true
  pager = true
```

也可以控制特定颜色

```
[color "status"]
  added = green
  changed = red bold
  untracked = magenta bold

[color "branch"]
  remote = yellow
```

或者使用：

```
git config --global color.ui auto
```

或者

```
git config --global color.ui auto
git config --global color.branch auto
git config --global color.status auto
```

## 参考

* [How to colorize output of git?](https://unix.stackexchange.com/questions/44266/how-to-colorize-output-of-git)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://huataihuang.gitbook.io/cloud-atlas-draft/devops/git/git_colorize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
