Git Push 避免用户名和密码方法
来源:互联网 发布:卖家淘宝发货回复大全 编辑:程序博客网 时间:2024/05/16 04:50
1.方法一
1.1 创建文件存储GIT用户名和密码
在%HOME%目录中,一般为C:\users\Administrator,也可以是你自己创建的系统用户名目录,反正都在C:\users\中。文件名为.git-credentials,由于在Window中不允许直接创建以"."开头的文件,所以需要借助git bash进行,打开git bash客户端,进行%HOME%目录,然后用touch创建文件 .git-credentials, 用vim编辑此文件,输入内容格式:
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com
1.2 添加Git Config 内容
进入git bash终端, 输入如下命令:
git config --global credential.helper store
执行完后查看%HOME%目录下的.gitconfig文件,会多了一项:
[credential] helper = store
重新开启git bash会发现git push时不用再输入用户名和密码
2.方法二
2.1 添加环境变量
在windows中添加一个HOME环境变量,变量名:HOME,变量值:%USERPROFILE%
2.2 创建git用户名和密码存储文件
进入%HOME%目录,新建一个名为"_netrc"的文件,文件中内容格式如下:
machine {git account name}.github.comlogin your-usernmaepassword your-password
重新打开git bash即可,无需再输入用户名和密码
0 0
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Push 避免用户名和密码方法
- Git Pull Push 避免用户名和密码方法
- 1119. Pre- and Post-order Traversals (30)
- .NET程序的代码混淆、加壳与脱壳
- DM368 NAND Flash启动揭秘
- ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
- 【NOIp 2010】【BFS】引水入城
- Git Push 避免用户名和密码方法
- java学习笔记之String,StringBuilder和StringBuffer
- 数据库--计算相邻行同一类的差值(date)
- 1508-张晨曦总结《2016年-11月-12日》【连续22天总结】
- python中匿名函数
- 百度地图在调试或者发布时显示空白的解决。
- http://www.tuicool.com/articles/2qiE7jN
- 一小时包教会 —— webpack 入门指南
- Android学习分享-常见控件03-ImageView详解