首页 > 代码库 > window 使用git 非ssh key 面密码登录
window 使用git 非ssh key 面密码登录
Windows下使用git bash时,总是提示输入用户名密码,严重影响了开发效率,经搜索查找找到了如下有效的解决方案,屡试不爽!
1、先创建存储用户名密码的文件 ,在home
文件夹,一般是 C:\Documents and Settings\Administrator
下建立文件.git-credentials
(windows
下不允许直接创建以.开头的文件,所以有一个小技巧:先创建一个文件名叫 )git-credentials
然后进入 git bash
使用命令:
mv git-credentials .git-credentials
2、用记事本打开这文件输入,如果用户名中有@,那么使用%代替:
https://{username}:{password}@github.com
例:https://wangshunyao:654321@github.com
保存;
3、重新进入 git bash,然后输入:
git config –global credential.helper store
执行完后去查看 C:\Documents and Settings\Administrator\.gitconfig
这个文件,发现多了一项: [credential]
helper = store
就成功了。
4、然后要重新打开 git bash 窗口,再操作就不用输入用户名密码了
window 使用git 非ssh key 面密码登录
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。