• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
古加纳
博客园    首页    新随笔    联系   管理    订阅  订阅

linux下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')

二 ssh设置

https://worktile.com/kb/ask/241884.html

参考连接

1 https://blog.51cto.com/u_13700957/5277030

快,滋醒这个做梦的人,有糖尿病的往后靠靠哈,不要给他点甜头!
posted @ 2024-03-25 13:54  古加纳  阅读(87)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3