网站制作模板,火爆网页游戏排行榜,中国互联网四大门户,数字化经营服务商git保存密码
每次登录都要输入密码是显示繁琐#xff0c;好在git提供了保存密码的功能。 在本地工程文件夹下#xff0c;.git目录#xff0c;保存以下配置。
[credential]
helper store或者 在git bash命令行#xff0c;执行命令
git config credential.helper store如…git保存密码
每次登录都要输入密码是显示繁琐好在git提供了保存密码的功能。 在本地工程文件夹下.git目录保存以下配置。
[credential]
helper store或者 在git bash命令行执行命令
git config credential.helper store如果希望全局保存可以加--global参数
git config --global credential.helper storegit删除保存密码配置
可以直接修改配置文件删除以下信息
[credential]
helper store或者 在git bash命令行执行命令
git config --unset credential.helper manager切换SSH提交方式
如果之前是采用帐号密码方式提交想切换为SSH提交可以按如下步骤操作
生成密钥对
按四次回车键。生成的gitee_id_rsa.pub是待会要用到的公钥。
ssh-keygen -t rsa -C 邮箱 -f /c/Users/用户名/.ssh/gitee_id_rsa修改SSH配置文件
修改SSH配置文件C:\Users\用户名\.ssh\config使之hosts文件映射关系。
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile /c/Users/用户名/.ssh/gitee_id_rsa# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile /c/Users/用户名/.ssh/github_id_rsa取消保存密码配置
在本地工程文件夹下.git目录取消保存密码配置。
git config --unset credential.helper managergit 切换远程仓库地址
查看远程仓库的地址
git remote -v删除远程仓库地址
git remote rm origin添加仓库地址需要添加git开头的地址不是https地址。
git remote add origin url或者用一条命令实现更换远程仓库地址URL为新地址
git remote set-url origin URL参考资料
git remote 命令 关于git 凭证存储 credential helper配置 git 更换远程地址的方法