据我所知,推送到 github 时的密码提示可以通过在 remote push url 中添加用户名:密码来避免。 .
https://you:password@github.com/you/example.git
这是 github 特定的安排还是这种格式可以用于任何 git 远程(https://username:password@somedomain.org/repo.git
)?
最佳答案
如果您使用 HTTPS,通过 GitHub 对您进行身份验证比将您的密码放在远程 URL 中更安全的方法是在 this 中生成一个新 token 。 GitHub 页面,然后像这样构建您的远程 URL:
https://<username>:<token>@github.com/<username>/<project_name>.git
关于Git Push - 远程 url 中的用户名和密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26544969/