【问题标题】:Git requests token instead of password [duplicate]Git请求令牌而不是密码[重复]
【发布时间】:2018-08-02 00:06:23
【问题描述】:

对于我在 git 中执行的每项操作,我都需要插入启用 2fa 时出现的用户名 + 安全令牌。

我不想每次操作都复制密钥,这非常耗时,我想插入一些我记得的东西,比如我的密码。

我该如何安排?

谢谢

【问题讨论】:

    标签: windows git github github-for-windows


    【解决方案1】:

    您可以使用这些命令来缓存令牌。

    设置 git 使用凭证内存缓存:
    git config --global credential.helper 缓存

    将缓存设置为 1 小时后超时(设置以秒为单位):
    git config --global credential.helper 'cache --timeout=3600'

    那么你只需每小时填写一次令牌。

    在此处查看更多信息: https://git-scm.com/docs/git-credential-cache

    【讨论】:

      猜你喜欢
      • 2018-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-20
      • 2021-01-13
      • 1970-01-01
      • 2019-05-24
      相关资源
      最近更新 更多