【问题标题】:echo -e "$(git status)" loses colors [duplicate]echo -e "$(git status)" 失去颜色[重复]
【发布时间】:2019-02-25 03:30:25
【问题描述】:

我正在尝试存储 a=$(git status) 以将其内容发送到脚本,然后将结果打印到终端。问题是 git 颜色没有消失。现在所有结果都没有颜色了。

这个问题有什么解决办法吗?

【问题讨论】:

    标签: bash git


    【解决方案1】:

    以下应该可以解决问题。

    a="$(git -c color.status=always status)"
    echo "$a"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-27
      • 1970-01-01
      • 2013-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-11
      相关资源
      最近更新 更多