码迷,mamicode.com
首页 > Windows程序 > 详细

window 使用git 非ssh key 面密码登录

时间:2017-05-26 13:25:31      阅读:273      评论:0      收藏:0      [点我收藏+]

标签:git bash   block   lob   glob   documents   oba   ash   .com   win   

Windows下使用git bash时,总是提示输入用户名密码,严重影响了开发效率,经搜索查找找到了如下有效的解决方案,屡试不爽!


1、先创建存储用户名密码的文件 ,在home文件夹,一般是 C:\Documents and Settings\Administrator下建立文件.git-credentialswindows下不允许直接创建以.开头的文件,所以有一个小技巧:先创建一个文件名叫 )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 面密码登录

标签:git bash   block   lob   glob   documents   oba   ash   .com   win   

原文地址:http://www.cnblogs.com/wangshunyao/p/6907807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!