gpt4 book ai didi

git - 设置用户名和密码返回 'github: command not found'

转载 作者:太空狗 更新时间:2023-10-29 13:02:29 24 4
gpt4 key购买 nike

我的工作环境完全可以使用 SSH,但在家里我更倾向于使用 GitHub for Windows 而不是 Git bash,所以这就是它设置为 http 的原因。 .

github --credentials get: github: command not foundUsername for 'https://github.com': userPassword for 'https://user@github.com': github --credentials store: github: command not foundAlready up-to-date.

在哪里可以找到并安装 github命令,这样我就不必每次都输入我的用户名和密码? (我想我可能需要在某处向 PATH 添加一些内容。)

最佳答案

您可以看看这篇非常有用的文章:Set up git .你有一个部分,他们向你解释如何保存你的密码。

没有 Github 可执行文件,因为 Github “只是”一个网站,您看到的消息是 git 尝试自动获取您的凭据(您可以按照上面链接中的指南解决此问题)。


无论如何我都想谈谈 SSH,因为它对到达这里的其他人很有用。

不过,存储密码的更好方法是不使用密码,而是使用 SSH key 。在您的 Github 设置中有一个选项可以添加一个新的,对于 Windows,只需使用 PuttyGen 或替代方法生成一个 key ,导出为 OpenSSH key ,然后复制/粘贴它在Github的文本区。
然后使用 SSH 选项克隆您的存储库:

git clone git@github.com:your_username/your_project.git 

或者,如果您有一个已经存在的存储库,请更改 url ( saw here ):

git remote set-url origin git@github.com:your_username/your_project.git

您将不再需要输入密码,而且非常安全(只要没有人可以访问您的计算机并复制私钥)。

关于git - 设置用户名和密码返回 'github: command not found',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13124141/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com