Help us understand the problem. What is going on with this article?

コマンドラインでのgitの色設定

More than 3 years have passed since last update.

MacのTerminalで、gitを実行したときの色設定を複数のMacで統一したかったので、設定内容をちょっとぐぐってみた。

自動的に色を設定する

何も考えずに設定するなら以下を実行すればOK

git config --global color.ui true

.gitconfigに直接記述するなら以下。

[color]
  ui = auto

各コマンドで色分けする

自分が困ってたケースだと、git statusを実行したときの色設定に差異があったこと。
以下のように.gitconfigに記述することで明示的に色を設定することができる。

[color "status"]
    added = yellow
    changed = green
    untracked = cyan

参考

Git - Git の設定
https://git-scm.com/book/ja/v1/Git-%E3%81%AE%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA-Git-%E3%81%AE%E8%A8%AD%E5%AE%9A

How to color the Git console in Ubuntu? - Stack Overflow
http://stackoverflow.com/questions/10998792/how-to-color-the-git-console-in-ubuntu

kouchi67
ぷろぐらむがかきたい
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした