Notion Blog
技术分享1 分钟阅读

配置 Gitee 免密登录的详细步骤

为啥用Gitee,gitlab国内不能使用了

1. 生成 SSH 密钥

ssh-keygen -t rsa -b 4096 -C "[email protected]"

(按回车接受默认设置,不设置密码)

2. 查看并复制公钥

cat ~/.ssh/id_rsa.pub

复制输出的全部内容

3. 添加公钥到 Gitee

登录 Gitee 账号
进入"设置" → "SSH公钥"
粘贴复制的公钥
添加标题(可选)
点击"确定"

4. 测试连接

ssh -T [email protected]

看到欢迎信息表示成功

5. 配置全局 Git 凭据存储

git config --global credential.helper store

6. 克隆/拉取项目

git clone [email protected]:username/repo.git

git pull

注意事项

确保使用 SSH URL ([email protected]:...),不是 HTTPS URL
首次操作需要输入账号密码,之后会自动保存
如需多账号管理,需配置 SSH config 文件

有关使用上的问题,欢迎您在底部评论区留言,一起交流~

读者评论

评论会同步写入该文在 Notion 中的页面底部(与正文同页,便于管理)。

0/1500

暂无评论,欢迎抢沙发。