【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配置公钥

验证

相关推荐
月初,6 小时前
Git 常用操作大全(超详细教程)一文教会你完全使用Git
大数据·git·elasticsearch
普通网友6 小时前
远程配置 VsCode:Github Copilot 安装成功却无法使用?细节避坑
vscode·github·copilot
李少兄8 小时前
Git 忽略文件机制:.gitignore 与 .git/info/exclude
java·git·elasticsearch
极智-9968 小时前
GitHub 热榜项目-日榜精选(2026-01-24)| AI智能体工具、Python生态等 | remotion、VibeVoice、goose等
人工智能·python·github·ai智能体·大模型部署·语音ai
github.com/starRTC11 小时前
Claude Code中英文系列教程17:将Claude Code集成在GitLab工作流里面
git·gitlab·github
JavaPub-rodert13 小时前
通过 GitHub 仓库下载微信 Mac & Windows 历史版本(Rodert 提供)
macos·微信·github
旅之灵夫13 小时前
【GitHub项目推荐--OpenEmu:macOS 复古游戏模拟器】
3d·github·策略模式
CCC:CarCrazeCurator13 小时前
git merge与rebase的区别及实操心得体会
git
草莓熊Lotso14 小时前
Qt 控件美化与交互进阶:透明度、光标、字体与 QSS 实战
android·java·开发语言·c++·人工智能·git·qt
小明同学0114 小时前
[C++进阶]深入理解二叉搜索树
开发语言·c++·git·visualstudio