【问题标题】:Coloured output with git in cmd在 cmd 中使用 git 进行彩色输出
【发布时间】:2011-04-20 03:25:35
【问题描述】:

有没有办法在 cmd 中使用 git 获得彩色输出?如果是,怎么做?

平台:XP SP3。

【问题讨论】:

    标签: git windows-xp cmd


    【解决方案1】:

    警告:在 Ubuntu 中测试。应该可以在 Windows 中工作,但未经测试。

    来自Git book的“自定义git”section

    查看git config 文档中的所有颜色。* 选项

    $ git config color.branch auto
    $ git config color.diff auto
    $ git config color.interactive auto
    $ git config color.status auto
    

    或者,您可以使用 color.ui 选项设置所有这些:

    $ git config color.ui true
    

    【讨论】:

    • 确认这在 Windows 上的 msysGit 的 Bash shell 中确实有效。此外,您可能希望使用命令git config --global color.ui true 使设置全局应用(而不仅仅是当前项目)
    猜你喜欢
    • 2015-07-15
    • 2021-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-07
    • 2020-08-31
    • 1970-01-01
    相关资源
    最近更新 更多