cloud_coin/GIT_README.md

62 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

要通过 git clone 将 Gitea 仓库 git@218.17.89.43:blade/cloud_coin.git 克隆到本地Gitea 服务运行在端口 10011需要使用 SSH 协议并显式指定端口。以下是正确命令和完整步骤:正确克隆命令(必须指定端口 10011bash
git clone ssh://git@218.17.89.43:10011/blade/cloud_coin.git
克隆后会在当前目录生成 cloud_coin 文件夹。
完整操作步骤1. 确保本地已配置 SSH 密钥bash
# 生成密钥(如果还没有)
ssh-keygen -t ed25519 -C "your_email@example.com"
查看公钥bash
cat ~/.ssh/id_ed25519.pub
复制全部内容,粘贴到 Gitea 网页的:
用户头像 → 设置 → SSH / GPG 密钥 → 添加密钥
2. 测试 SSH 连接强烈推荐bash
ssh -T -p 10011 git@218.17.89.43
成功会显示:
Hi there, You've successfully authenticated...
如果提示 Permission denied (publickey),说明密钥未添加或 SSH 服务未启用。
3. 执行克隆bash
git clone ssh://git@218.17.89.43:10011/blade/cloud_coin.git
简化后续操作(推荐配置 ~/.ssh/config编辑 ~/.ssh/config 文件没有就创建plaintext
Host gitea-cloud
HostName 218.17.89.43
User git
Port 10011
IdentityFile ~/.ssh/id_ed25519
保存后以后克隆、push、pull 都只需写bash
git clone gitea-cloud:blade/cloud_coin.git
非常简洁!常见错误提醒错误写法
问题
git clone git@218.17.89.43:blade/cloud_coin.git
未指定端口,默认连 22失败
git clone git@218.17.89.43:10011/blade/cloud_coin.git
缺少 ssh://,部分系统会报错
总结最终推荐命令一次配置永久使用bash
# 1. 配置 ~/.ssh/config如上
# 2. 克隆
git clone gitea-cloud:blade/cloud_coin.git
或直接使用完整 URLbash
git clone ssh://git@218.17.89.43:10011/blade/cloud_coin.git
克隆成功后,你就可以在本地进行 git pull、git push 等操作了。