文章版本: Enterprise Server 2.17
为什么 Git 总是询问我的密码?
如果 Git 在您每次尝试与 GitHub 交互时均提示输入用户名和密码,则您可能为仓库使用的是 HTTPS 克隆 URL。
Using an HTTPS remote URL has some advantages compared with using SSH. It's easier to set up than SSH, and usually works through strict firewalls and proxies. 但是,每次拉取或推送仓库时,它也会提示您输入 GitHub 凭据。
You can avoid being prompted for your password by configuring Git to store it for you. Once you've configured it, Git automatically uses your cached password when you pull or push a repository.