Why do GitHub HTTPS schemes always ask for my password?

I cloned a repo at git hub via the https:// protocol to avoid setting up the SSH key stuff. This is all good except every time I push it asks for my password. Is there any way to get git to cache my password?


You will see an ssh-agent to store the password. There are ways to cache your password listed here.


You may want GitHub's credential caching for Smart HTTP. According to the blog post, it only works with Windows and OS X, so you should use the GIT protocol instead if you're on a Linux or Unix workstation.


Use an authentication token in ~/.netrc file, typing password can be avoided.

Recently github added the token feature. Go to settings/applications then create a personal access token. The syntax in netrc is one-line: machine github.com login <login> password <token> .

Even better feature, the token is intended to allow users not use the account password for project work. Only use the password when doing admin work, like creating new token or revoke an old token.

See another SO post for ways of credential caching: Is there a way to skip password typing when using https:// github

链接地址: http://www.djcxy.com/p/22066.html

上一篇: Git推送导致“身份验证失败”

下一篇: 为什么GitHub HTTPS方案总是要求我输入密码?