How to color the Git console?

前端 未结 11 1133
借酒劲吻你
借酒劲吻你 2020-11-30 16:07

I recently saw that the git console in Windows is colored, e.g. Green for additions, red for deletions, etc. How do I color my git console like tha

11条回答
  •  心在旅途
    2020-11-30 16:36

    refer here: https://nathanhoad.net/how-to-colours-in-git/

    steps:

    1. Open ~/.gitconfig for editing

      vi ~/.gitconfig

    2. Paste following code:

      [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
      
    3. Save the file.

    Just change any file in your local repo and do

    git status
    

提交回复
热议问题