Git bash 操作记住密码
2015-08-04 16:02
501 查看
git for windows (又名 msysgit)如何记住用户名和密码
创建存储用户名密码的文件
在home文件夹,一般是 C:\Documents and Settings\Administrator 下建立文件 .git-credentials (windows下不允许直接创建以.开头的文件,所以有一个小技巧:先创建一个文件名叫 )git-credentials
然后进入 git bash 使用命令:
mv git-credentials .git-credentials
用记事本打开这文件输入,如果用户名中有@,那么使用%代替:
https://{username}:{password}@github.com
比如: https://zhangsan:123456@github.com 保存
添加config项
在任意文件夹下右键进入 git bash
然后输入:
git config --global credential.helper store
执行完后去查看 C:\Documents and Settings\Administrator\.gitconfig 这个文件,发现多了一项:
[credential]
helper = store
就成功了。
然后要重开 git bash 窗口,再提交就不用输入用户名密码
创建存储用户名密码的文件
在home文件夹,一般是 C:\Documents and Settings\Administrator 下建立文件 .git-credentials (windows下不允许直接创建以.开头的文件,所以有一个小技巧:先创建一个文件名叫 )git-credentials
然后进入 git bash 使用命令:
mv git-credentials .git-credentials
用记事本打开这文件输入,如果用户名中有@,那么使用%代替:
https://{username}:{password}@github.com
比如: https://zhangsan:123456@github.com 保存
添加config项
在任意文件夹下右键进入 git bash
然后输入:
git config --global credential.helper store
执行完后去查看 C:\Documents and Settings\Administrator\.gitconfig 这个文件,发现多了一项:
[credential]
helper = store
就成功了。
然后要重开 git bash 窗口,再提交就不用输入用户名密码
相关文章推荐
- 工作常用shell集合
- shell脚本:批量添加用户,并设置随机字符为密码
- shell 统计nginx访问日志的前10
- 设计Windows shell中set 命令的人应该好好反省一下自己(用set处理串时请注意空格)
- Shell脚本中执行mysql语句
- Makefile经典教程(掌握这些足够)
- 关于shell脚本时遇value too great for base (error token is "08")
- shell的含义
- shell编程之sed
- Shell脚本常用判断
- Python的Crypto模块使用:自动输入Shell中的密码
- Python的Crypto模块使用:自动输入Shell中的密码
- SHell命令总结
- shell编程之正则表达式
- 基本排序(二)插入排序(直接插入、Shell、折半)
- Linux查看系统信息的一些命令及查看已安装软件包的shell
- Bash Shell字符串操作
- Linux Shell常用技巧
- Shell日期时间和时间戳的转换
- hbase 列族优化 ,shell 管理集群