【问题标题】:Git requires username and password for git push, git pull using HTTPS methodGit 需要用户名和密码进行 git push、git pull 使用 HTTPS 方式
【发布时间】:2018-02-06 11:44:51
【问题描述】:

所以,当我使用 HTTPS 方法克隆 git 存储库并进行一些更改并将 pushpull 更改为 git 时,它总是会提示我输入 username and password。解决办法是什么?

【问题讨论】:

标签: linux git git-push git-pull git-clone


【解决方案1】:

你的问题的解决方案是这个 git 命令,它让我想起了 GIT。

git config credential.helper store

阅读本文了解详情: GIT credentials store

【讨论】:

    【解决方案2】:

    除了更改为 SSH,如果您不介意以明文形式输入密码,您还可以继续使用 HTTPS。把它放在你的 ~/.netrc 中,它不会询问你的用户名/密码(至少在 Linux 和 Mac 上)

    在你的主目录中创建一个.netrc 文件。

    machine github.com
            login <user>
            password <password
    

    【讨论】:

    • 不介意以明文形式输入密码是什么意思?你的意思是 netrc 使用明文?
    猜你喜欢
    • 2014-04-02
    • 1970-01-01
    • 2013-12-23
    • 2019-04-03
    • 2014-05-03
    • 1970-01-01
    • 2021-01-27
    相关资源
    最近更新 更多