今天在弄jenkins一建发版,遇到了git下载每次都要输入账号密码,所以百度一下,使用一下方法,搞定

一、通过文件方式

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

touch .git-credentials
vim .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'

linux 保存git的账号密码的更多相关文章

  1. Linux让git记住账号密码

    Linux让git记住账号密码 ——IT唐伯虎 摘要: Linux让git记住账号密码. 1.进入根目录,指令:cd / 2.创建记录账号密码的文件,指令:touch .git-credentials ...

  2. git保存仓库的账号密码

    1.执行保存账号命令 # 保存本地仓库的账号git config --local credential.helper store # 保存git全局账号git config --global cred ...

  3. 在mac中自动保存git用户名与密码如此简单

    之前为了实现在Windows中自动保存git用户名与密码,写过一篇博客终于解决“Git Windows客户端保存用户名与密码”的问题,需要进行一堆配置. 而在Mac OS X中这个操作竟然如此简单.只 ...

  4. Github新安全措施:停止Git客户端账号密码登录的解决方案

    今年 8 月 13 日之后,如果你还用账户密码来操作 Github 上的仓库,就会收到如下警告: remote: Support for password authentication was rem ...

  5. git登录账号密码错误remote: Incorrect username or password (access token)

    git提交时弹框让输入用户和密码,不小心输入错误了 再次提交 一直就提示  remote: Incorrect username or password 错误了,也不弹框要重新输入 解决方法 win1 ...

  6. git修改账号密码

    查看当前用户名和邮箱 git config user.name git config user.email 修改 git config --global user.name "新用户名&qu ...

  7. linux 下 修改mysql账号密码

    1.root用户登录到mysql数据库代码示例:/usr/local/mysql/bin/mysql -u root -p (输入密码进入mysql)2.进入mysql,输入:代码示例:use mys ...

  8. git重置账号密码

    1.打开控制面板(快捷打开win+R,输入control) 2.点击打开用户账户 3.点击凭据管理器 4.点击windows凭据删除你的git凭据即可

  9. [转]git登录账号密码错误remote: Incorrect username or password

    链接地址:https://baijiahao.baidu.com/s?id=1622020216177100162&wfr=spider&for=pc

随机推荐

  1. hadoop HA学习

    一 HDFS HA架构图 二 HDFS HA组件 Active NameNode和Standby NameNode 在NameNode的HA方案中有两个不同状态的NameNode,分别为活跃态(Act ...

  2. Varnish http缓存服务器

    http://blog.51cto.com/hexiaoshuai/1909183 https://jefferywang.gitbooks.io/varnish_4_1_doc_zh/content ...

  3. 【转】FluentAPI详细用法

    设置主键modelBuilder.Entity<x>().HasKey(t => t.Name); 设置联合主键modelBuilder.Entity<x>().HasK ...

  4. 常用的lamp环境以及一些依赖包的安装

  5. 错误:Could not find a getter for CreatTime in class

    org.hibernate.PropertyNotFoundException: Could not find a getter for CreatTime in class org.com.xk.h ...

  6. [Codeforces178F2]Representative Sampling

    Problem 给定n个字符串Si,任意选出k个字符串Ai,使得其中任意两个字符串lcp之和最大. Solution 建一棵trie树,枚举每一个节点对答案的贡献,树形dp,时间复杂度像是O(N^3) ...

  7. [宽度优先搜索] FZU-2150 Fire Game

    Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns) ...

  8. python基础之作业1---用户登录

    作业:编写登陆接口 输入用户名密码 认证成功后显示欢迎信息 输错三次后锁定 import sys, os, getpass os.system('clear')i = 0while i < 3: ...

  9. python ---split()函数讲解

    python ---split()函数讲解 split中文翻译为分裂. 在python用于分割字符串使用. split()就是将一个字符串分裂成多个字符串组成的列表. split()可以传入参数,也可 ...

  10. Promise学习使用

    Promise是承诺的意思,“承诺可以获取异步操作的消息”,是一种异步执行的方案,Promise有各种开源实现,在ES6中被统一规范,由浏览器直接支持. Promise 对象有三种状态:pending ...