当我做
git push
Run Code Online (Sandbox Code Playgroud)
我得到命令提示符
Username for 'https://github.com':
Run Code Online (Sandbox Code Playgroud)
然后我手动输入我的用户名
Username for 'https://github.com': myusername
Run Code Online (Sandbox Code Playgroud)
然后我点击Enter并提示我输入密码
Password for 'https://myusername@github.com':
Run Code Online (Sandbox Code Playgroud)
我希望用户名自动写入,而不是一直手动输入。
我尝试这样做,xdotool
但没有成功。
我已经做了
git config --global user.name myusername
git config --global user.email myemail@gmail.com
Run Code Online (Sandbox Code Playgroud)
但它仍然总是要求我手动输入
pro*_*sti 46
在终端中,输入以下内容以启用凭证记忆:
$ git config --global credential.helper cache
Run Code Online (Sandbox Code Playgroud)
您可以更新默认密码缓存超时(以秒为单位):
# This cache timeout is in seconds
$ git config --global credential.helper 'cache --timeout=3600'
Run Code Online (Sandbox Code Playgroud)
您也可以使用(但请使用单引号,否则双引号可能会中断某些字符):
$ git config --global user.name 'your user name'
$ git config --global user.password 'your password'
Run Code Online (Sandbox Code Playgroud)
Die*_*cia 17
实际上,您在那里所做的是设置作者信息,仅用于提交。您没有存储凭据。凭证可以通过两种方式存储:
小智 7
从git scm复制这个
$ git config credential.helper store
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>
[several days later]
$ git push http://example.com/repo.git
Run Code Online (Sandbox Code Playgroud)
[您的凭据将自动使用]
归档时间: |
|
查看次数: |
121112 次 |
最近记录: |