git clone https:// don't input username and password

Apart from changing to SSH you can also keep using HTTPS, if you don't mind to put your password in clear text. Put this in your ~/.netrc and it won't ask for your username/password (at least on Linux):

machine github.com
       login <user>
       password <password>

Addition (see VonC's 2nd comment): on Windows the file name is %HOME%\_netrc.

Also read VonC's first comment in case you want to encrypt.

share | improve this answer
 
2 
Yeah, it works on Linux, but doesn't work for gitbash on Windows. –  Sales Apr 12 '13 at 16:56
5 
From a security point of view, it is a very bad idea. –  dolmen Sep 20 '13 at 14:17
2 
@dolmen I see what you mean, but if you mind putting your password in a clear text, you can... encrypt it ;) See stackoverflow.com/a/18362082/6309. and that is even compatible with the 2-factor authentication (2FA) of Github: stackoverflow.com/a/18607931/6309 –  VonC Nov 21 '13 at 8:29
2 
@Sales it works perfectly from a DOS session or a git bash on Windows, provided you call your file %HOME%\_netrc (instead of ~/.netrc). See also stackoverflow.com/a/18362082/6309 to encrypt that file. –  VonC Nov 21 '13 at 8:30
 
This also works in Mac. Great –  Guixing Bai Dec 19 '13 at 4:52
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值