【问题标题】:Github asking for password [duplicate]Github要求输入密码[重复]
【发布时间】:2013-12-21 06:13:42
【问题描述】:

当推送到远程仓库时会发生这种情况:

我过去创建了一个仓库,我不需要输入密码。为什么不适用于所有 repo?

【问题讨论】:

标签: git version-control github


【解决方案1】:

这是因为您使用的 https:// 需要密码,而不是使用 SSH 密钥的 git:// URL。

GitHub 实际上有一个关于这个https://help.github.com/articles/which-remote-url-should-i-use的文档

【讨论】:

    【解决方案2】:

    您已使用 https url 语法添加远程:

    git remote add origin https://github.com/zoliky/abctest.git
    

    如果你想使用 ssh 密钥,你应该使用 ssh url 语法:

    git remote add origin git@github.com:zoliky/abctest.git
    

    现在要更改它,请执行以下操作:

    git remote set-url origin git@github.com:zoliky/abctest.git
    

    Github 的解释是here

    【讨论】:

      猜你喜欢
      • 2019-04-21
      • 2013-05-23
      • 1970-01-01
      • 1970-01-01
      • 2022-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多