【问题标题】:Git DOES NOT require username and password. How can I change it to do so?Git 不需要用户名和密码。我怎样才能改变它呢?
【发布时间】:2017-01-27 13:39:06
【问题描述】:

似乎common scenario 将位于安全的计算机中,并在从 RStudio 将分支推送到 GitHub 时收到输入用户名和密码的提示。

我有相反的问题。我不记得我是如何设置的,但它不要求用户名和密码,自动推送提交的分支。

如何调转设置,每次都提示?

【问题讨论】:

  • GitHub 配置文件设置 > SSH & GPG 密钥 > 删除与您要提示输入用户名和密码的 PC 相关的 SSH 密钥。
  • @J.Titus 我在那里,但上面写着“没有 SSH 密钥可以访问您的帐户”和“没有 GPG 密钥可以访问您的帐户。”
  • git config --get credential.helper 的输出是什么?
  • 如果你得到任何输出,那么你已经定义了一个凭证助手,这可能会缓存你的凭证。
  • @ScottWeldon 你知道如何摆脱它吗?

标签: git github rstudio


【解决方案1】:

首先,做:

git config credential.helper

如果这给了你任何输出,那么你已经定义了一个凭证助手,它可能正在缓存你的凭证。

要禁用帮助程序,请执行以下操作:

git config --unset credential.helper

根据定义助手的位置,您可能还需要包括--system--global--local 之一。例如:

git config --global --unset credential.helper

【讨论】:

  • 我得到manager 作为git config credential.helper 的输出,fatal: not in a git directory 作为git config --unset credential.helper 的输出。你知道这意味着什么吗?
  • @Toni 它可能是在系统或全局级别定义的。正如我的回答中提到的,请尝试带有--system--global 标志的--unset 命令。
  • 整个命令是什么,例如--system?
  • @Toni:更新了我的答案。
猜你喜欢
  • 2013-05-24
  • 2014-04-02
  • 1970-01-01
  • 2022-10-01
  • 2017-06-24
  • 2021-07-06
  • 2022-01-24
相关资源
最近更新 更多