首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >git pull 提示输入密码的解决办法!

git pull 提示输入密码的解决办法!

原创
作者头像
用户10171634
发布2025-09-23 09:46:52
发布2025-09-23 09:46:52
18300
代码可运行
举报
运行总次数:0
代码可运行

上传到 GitLab

  1. 登录 GitLab
  2. 进入 头像 → Preferences → SSH Keys
  3. id_rsa.pub 里的内容粘贴进去
  4. 点击 Add key 2️⃣ 配置 ~/.ssh/config

~/.ssh/config 里指定不同主机用哪个私钥,例如:

代码语言:javascript
代码运行次数:0
运行
复制
# GitLab
Host gitlab.com
    HostName gitlab.com
    User git
    IdentityFile ~/.ssh/id_rsa_gitlab

# GitHub
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_github

# 公司 GitLab 内网
Host git.company.com
    HostName git.company.com
    User git
    IdentityFile ~/.ssh/id_rsa_company

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 上传到 GitLab
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档