git push 免密
作者:
凝月霜雪 | 来源:发表于
2019-10-12 20:05 被阅读0次
window环境
- 在windows中添加一个HOME环境变量,变量名:HOME,变量值:%USERPROFILE%
- 直接打开桌面上的电脑,在最上边的位置,输入%HOME%,回车进入该目录,新建一个名为"_netrc"的文件,没有后缀名
文件内容:
machine github.com主机地址
login 要提交主机的用户名
password 密码
Linux
- 在~/下,
touch .git-credentials
,在文件中输入
https://{username}:{password}[@github.com
- 执行
git config --global credential.helper store
命令,执行之后会在~/.gitconfig文件中多credential项
[user]
name = xxx
email = xxxx@xxxx.com
[credential]
helper = store
- 之后cd到项目目录,执行git pull命令,会提示输入账号密码。输完这一次以后就不再需要
本文标题:git push 免密
本文链接:https://www.haomeiwen.com/subject/wqscmctx.html
网友评论