博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux下 保存 git账号密码
阅读量:7065 次
发布时间:2019-06-28

本文共 522 字,大约阅读时间需要 1 分钟。

一、通过文件方式

1.在~/下, touch创建文件 .git-credentials, 用vim编辑此文件,输入内容格式:

touch .git-credentialsvim .git-credentials

在里面按“i”然后输入: https://{username}:{password}@github.com 

比如 https://account:password@github.com

2. 在终端下执行

git config --global credential.helper store

3. 可以看到~/.gitconfig文件,会多了一项:

[credential]helper = store

4.OK

 

二、通过缓存方式

要求:git版本需要>=1.7.10

git config --global credential.helper cache# 默认缓存密码15分钟,可以改得更长, 比如1小时git config --global credential.helper 'cache --timeout=3600'

 

转载于:https://www.cnblogs.com/boystar/p/5644025.html

你可能感兴趣的文章
深入浅出JVM
查看>>
使用X Manager远程CentOS 7服务器(XDMCP)
查看>>
写sql语句时将时间格式“20110725”转化为格式2012年07月25日
查看>>
[Hadoop in China 2011] 蒋建平:探秘基于Hadoop的华为共有云
查看>>
heartbeat高可用+lvsDR
查看>>
方丈被害子女有没有权利继承遗产?
查看>>
java入门第一季5、6
查看>>
[转载] 闻一多——七子之歌
查看>>
针对tomcat日志乱码问题
查看>>
免费的协作和协同办公软件平台onlyoffice轻松部署
查看>>
WiFi覆盖下的生活 享受便利的同时 别忘记了安全
查看>>
关于ios 8 7 下的模态窗口大小的控制 代碼+場景(mainstoryboard)( Resizing UIModalPresentationFormSheet )...
查看>>
Linux软件包的管理--YUM
查看>>
Axis2发布webservice(1)--0配置发布
查看>>
Java Web笔记 – Servlet中的Filter过滤器的介绍和使用 编写过滤器
查看>>
我奋斗了18年,不是为了和你一起喝咖啡
查看>>
gearman简单介绍
查看>>
《Typecript 入门教程》 3、接口
查看>>
jsp的几种跳转比较
查看>>
用oracle查询当前数据库中的所有表
查看>>