【Git】本地搭建Gitee、Github环境

本地 (Local)

1、使用命令生成公钥(pub文件)

bash 复制代码
1. $ ssh-keygen -t rsa -C "xxxxxxx@email.com" -f "github_id_rsa"
2. $ ssh-keygen -t rsa -C "xxxxxxx@email.com" -f "gitee_id_rsa"

2、创建config文件,并配置

bash 复制代码
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_id_rsa

# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_id_rsa

远程(Remote)

1、gitee配置公钥

2、github配置公钥

验证

相关推荐
weixin_66822 分钟前
GitHub 2026年AI项目详细数据汇总表-AI分析-分享
人工智能·github
CoderJia程序员甲17 小时前
GitHub 热榜项目 - 日榜(2026-02-05)
ai·开源·大模型·github·ai教程
stevenzqzq17 小时前
git 常用操作
大数据·git
weixin_66818 小时前
GitHub 2026年AI项目热度分析报告-AI分析-分享
人工智能·github
Curvatureflight19 小时前
Git工作流最佳实践:从混乱到优雅
git
MicrosoftReactor20 小时前
技术速递|GitHub Copilot CLI 斜杠命令速查表
github·copilot·cli
wu~97020 小时前
GitHub永不遗忘,使用git push -f来覆盖的提交依旧保留
git·github
m0_6948455720 小时前
music-website 是什么?前后端分离音乐网站部署实战
linux·运维·服务器·云计算·github
独自破碎E20 小时前
已经 Push 到远程的提交,如何修改 Commit 信息?
开发语言·github
Vermouth_0021 小时前
git clone的时候提示access denied
git