【问题标题】:When I type git config --list my user.password is also showing in plain text当我输入 git config --list 我的 user.password 也以纯文本显示
【发布时间】:2019-12-04 10:44:37
【问题描述】:

当我在终端中输入 git config --list 时,如何隐藏或不显示 user.password。

【问题讨论】:

标签: git github terminal


【解决方案1】:

您可以在类 Unix 终端上使用以下命令:

git config --list | grep -v "user.password"

【讨论】:

  • 我仍然可以看到带有纯文本密码的 user.password
  • 这很奇怪,因为grep -v 隐藏了所有包含字符串user.password 的行。您使用的是哪个 shell(cygwin/linux/unix)?
【解决方案2】:

您只能通过首先不将密码输入到 git config 来避免显示您的密码。正如@EncryptedWatermelon 建议的那样,试试git credentials

grep -v 仅过滤您的命令输出,不会更改您的实际配置文件。如果之后再次输入git config --list,密码仍然存在。不幸的是,git config --list 总是输出你的整个 git 配置,并且你无能为力

【讨论】:

    猜你喜欢
    • 2021-11-30
    • 2017-06-06
    • 2013-12-02
    • 2018-05-31
    • 1970-01-01
    • 2020-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多