"git Branch -vv"の出力色を変更する方法

私はこれが--format引数が必要であることを発見しました。

       --format <format>
           A string that interpolates %(fieldname) from a branch ref being shown and the object it points at. The format is the same as that of git-for-each-ref(1).

探してman git-for-each-refみました。

 When unspecified, <format> defaults to %(objectname) SPC %(objecttype) TAB %(refname).

下の例は次のとおりです。

           --format='From: %(*authorname) %(*authoremail)
           Subject: %(*subject)
           Date: %(*authordate)
           Ref: %(*refname)

           %(*body)
           ' 'refs/tags'

--format="ref=%(refname)"

私がもっとよく知らないこともあります。

私が望むのはここで青い色合いを変更するだけです。助けてください! ここに画像の説明を入力してください。

ベストアンサー1

長すぎる。

  • git config -g color.branch.upstream 'red bold'

子コマンド:

git config color.branch.upstream '<fg-color> [<bg-color>] [<attribute>...]'

Git設定ファイル:

[color "branch"]
    upstream = <fg-color> [<bg-color>] [<attribute>...]

可能な<fg-color>合計<bg-color>値:

black   blue   cyan  default  green
magenta normal red   white    yellow

bright必要に応じて、これらの色を表すためにプレフィックスを追加するか、#RRGGBB値の明るい色合いを使用します。


可能な<attribute>値:

blink   bold   ul   italic
reverse strike dim

例:

git config color.branch.upstream 'yellow red bold ul'
git config color.branch.upstream brightblue
git config color.branch.upstream '#c0c0ff'

git-config(1)詳しくはマニュアルページをご覧ください。すべての端末ですべての機能がサポートされるわけではありません。また、 --global フラグを使用してグローバルに変更することを忘れないでください:)

おすすめ記事