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 窗口,再提交就不用输入用户名密码
参考资料:
git-credential-cache(1) Manual Page
NAME
git-credential-cache - helper to temporarily store passwords in memory
SYNOPSIS
git config credential.helper 'cache [options]'
DESCRIPTION
This command caches credentials in memory for use by future git programs. The stored credentials never touch the disk, and are forgotten after a configurable timeout. The cache is accessible over a Unix domain socket, restricted to the current user by filesystem permissions.
You probably don’t want to invoke this command directly; it is meant to be used as a credential helper by other parts of git. Seegitcredentials(7) or EXAMPLES below.
OPTIONS
- --timeout <seconds>
-
Number of seconds to cache credentials (default: 900).
- --socket <path>
-
Use <path> to contact a running cache daemon (or start a new cache daemon if one is not started). Defaults to ~/.git-credential-cache/socket. If your home directory is on a network-mounted filesystem, you may need to change this to a local filesystem.
CONTROLLING THE DAEMON
If you would like the daemon to exit early, forgetting all cached credentials before their timeout, you can issue an exit action:
git credential-cache exit
EXAMPLES
The point of this helper is to reduce the number of times you must type your username or password. For example:
$ git config credential.helper cache
$ git push http://example.com/repo.git
Username: <type your username>
Password: <type your password> [work for 5 more minutes]
$ git push http://example.com/repo.git
[your credentials are used automatically]
You can provide options via the credential.helper configuration variable (this example drops the cache time to 5 minutes):
$ git config credential.helper 'cache --timeout=300'
git for windows (又名 msysgit)如何记住用户名和密码的更多相关文章
- git 记住用户名和密码
git 记住用户名和密码 在使用 git 时,如果用的是 HTTPS 的方式,则每次提交,都会让输入用户名和密码,久而久之,就会感觉非常麻烦,那么该如何解决呢? 1. 使用 SSH,添加 ssh ke ...
- Tortoisegit 记住用户名和密码
Tortoisegit 记住用户名和密码方法: [Windows系统] 当你配置好git后,在 C:\Documents and Settings\Administrator\ 目录下有一个 .gi ...
- TortoiseGit:记住用户名和密码
1.背景: 我们在使用 tortoisegit 工具时会无可避免的经常性 pull 和 push,这时通常要输入用户名和密码,由于麻烦,就有人提出了记住用户名和密码的需求... ... 2.设置: [ ...
- OpenVPN 如何记住用户名和密码
最近在使用OpenVPN,但是没有记住用户名和密码功能,太坑人,研究一下发现是可以的. 1. 在OpenVPN安装目录下\OpenVPN\config文件夹中找到vpnserver.ovpn文件. 2 ...
- ASP.NET中登录时记住用户名和密码(附源码下载)--ASP.NET
必需了解的:实例需要做的是Cookie对象的创建和对Cookie对象数据的读取,通过Response对象的Cookies属性创建Cookie,通过Request对象的Cookies可以读取Cookie ...
- 通过jquery.cookie.js实现记住用户名、密码登录功能
Cookies 定义:让网站服务器把少量数据储存到客户端的硬盘或内存,从客户端的硬盘读取数据的一种技术: 下载与引入:jquery.cookie.js基于jquery:先引入jquery,再引入:jq ...
- jQuery cookie 实现记住用户名和密码功能
jQuery cookie 实现记住用户名和密码功能 HTML代码 <div class="wrap"> <div class="line-top&qu ...
- SVN记住用户名和密码后如何修改
今天遇到一个SVN检出代码用户验证问题.由于自己最近参与了好几个项目,一时间忙不过来.所以希望跟着自己的试用期的同事帮我测试一下刚修改完成的新功能是否有问题.但是该同事没有项目中权限,正好今天恰逢星期 ...
- (转)ASP.NET里面简单的记住用户名和密码
using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using S ...
- jquery实现记住用户名和密码
这里我们选择的方法是cookie的方式去记录 首先我们写将用户名和密码写到cookie的js代码 //保存到cookie function save_cookies(){ if($("#re ...
随机推荐
- 读书笔记:php_tizag_tutorial
昨天在实验室花了一天时间看了英文版的php_tizag_tutorial,因为上学期用php和bootstrap写过一个租房网站,对php还是比较熟悉.现在总结一下php_tizag_tutorial ...
- OGR 官方文档
OGR 官方文档 http://www.gdal.org/ogr/index.html The OGR Simple Features Library is a C++ open source lib ...
- WebStorm开发Nodejs环境搭建,包括破解最新的WebStom11破解
先放上链接:http://pan.baidu.com/s/1eQUJZGm 文件内包含注册码和WebStom11安装包,希望能够帮助到大家,少些周折
- 130831组队赛-Regionals 2011, Asia - Kuala Lumpur
A.Smooth Visualization 简单模拟题,不多说了. #include<iostream> #include<cstdio> #include<algor ...
- perl 自动登陆网站发短信
use LWP::UserAgent; use HTTP::Date qw(time2iso str2time time2iso time2isoz); use Net::Ping; use Sock ...
- http://www.cutt.com/
简网APP工场-服务介绍 服务介绍
- 透过表象看本质!?之三——Kalman滤波
数据拟合能够估计出数据变化的趋势,另外一个同等重要的应用是如何利用这一趋势,预测下一时刻数据可能的值.通俗点儿说,你观察苍蝇(蚊子,蜜蜂)飞了几秒,你也许会想“它下一个时刻可能在哪儿”,“呈现出什么样 ...
- Windows Azure入门教学系列 (一): 创建第一个WebRole程序
原文 Windows Azure入门教学系列 (一): 创建第一个WebRole程序 在第一篇教学中,我们将学习如何在Visual Studio 2008 SP1中创建一个WebRole程序(C#语言 ...
- SIMPASS技术解析
一.什么叫SIMPASS SIMpass技术融合了DI卡技术和SIM卡技术,或者称为双界面SIM卡.SIMpass是一种多功能的SIM卡,支持接触与非接触两个工作接口,接触界面实现SIM功能,非接触界 ...
- MFC画二维动态图表[GDI]
源博客:http://www.codeproject.com/Articles/9350/2D-Animated-Charts 源代码:http://download.csdn.net/detail/ ...