[git] credential helper 让你的 https 不再需要输入用户名密码

参考: https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E5%87%AD%E8%AF%81%E5%AD%98%E5%82%A8

介绍

在使用宇宙无敌最强版本管理 git 时, 如果使用 https 连接, 通常要求你输入 username & password.
那么如何可以不用每次都输入 username & password 呢?

  • 采用 SSH 连接方式
    前提当然你得有权限将自己主机 id_rsa.pub 加入到 git 账户的 SSH Keys
  • 采用 HTTPS 连接方式
    只要你有仓库访问权限即可, 使用本文即将介绍的 credential 来配置一下即可

配置 credential helper

存储配置到本地 ~/.my-credentials 文件

git config --global credential.helper store --file ~/.my-credentials

下一次 git pull/git push 时, 输入的 usernamepassword 将会被保存到 ~/.my-credentials 中;
以后再次 git pull/git push 将不再需要 usernamepassword .

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值