创建自己的github.io

1、创建GitHub账号

bash 复制代码
GitHub地址:https://github.com/
点击Sign up创建账号
如果已创建,点击Sign in登录

2、创建仓库

bash 复制代码
假设Owner为username,则Repository name为username.github.io

说明:
1、Owner为用户名
2、Repository name为仓库名,格式为:用户名.github.io

3、配置SSH-Key

3.1、生成SSH密钥

bash 复制代码
ssh-keygen -t rsa -f ~/.ssh/github_id_rsa

3.2、查看SSH公钥

bash 复制代码
cat ~/.ssh/github_id_rsa.pub

3.3、部署公钥

bash 复制代码
详见:
https://gitee.com/help/articles/4181#article-header0
https://docs.github.com/zh/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

4、克隆项目

bash 复制代码
git clone git@github.com:username/username.github.io.git

5、创建文件

bash 复制代码
cd username.github.io
echo "Hello World" > index.html

6、提交文件

bash 复制代码
git add .
git commit -m "Initial commit"
git push -u origin main

7、浏览器访问

bash 复制代码
浏览器访问域名:username.github.io

8、配置CNAME

bash 复制代码
如果不想配置CNAME,忽略以下操作。

8.1、以阿里云域名为例,配置CNAME

8.2、给GitHub的username.github.io仓库配置自定义域名

8.3、查看GitHub的username.github.io仓库

bash 复制代码
发现仓库多了一个文件,文件名为CNAME,文件内容为自定义的域名

8.4、浏览器访问

bash 复制代码
1、访问自定义域名username.xxx.yyy
2、访问username.github.io会跳转到username.xxx.yyy

9、详见

bash 复制代码
https://pages.github.com/
https://docs.github.com/zh/pages
相关推荐
James_WangA1 小时前
我给 AOI 设备装了一个 Agent,然后发现工具注册才是最难写的
架构·github
James_WangA1 小时前
产线上跑 Agent:LLM 挂了不是 500 错误,是停线
架构·github
Hommy886 小时前
【开源剪映小助手】字幕接口
开源·github·aigc·剪映小助手·视频剪辑自动化
一袋米扛几楼988 小时前
【Git】规范化协作:详解 GitHub 工作流中的 Issue、Branch 与 Pull Request 最佳实践
前端·git·github·issue
尘埃落定wf9 小时前
# GitHub CLI:告别繁琐的 Git 命令,让开发更高效
git·github
zh_xuan9 小时前
上传api调试工具到github
github
AIMath~11 小时前
彻底删除 GitHub 仓库中特定文件夹的完整指南
github
DogDaoDao12 小时前
【GitHub】OpenClaw:开源个人AI助手的新标杆
人工智能·深度学习·开源·大模型·github·ai编程·opeclaw
一点一木20 小时前
🚀 2026 年 4 月 GitHub 十大热门项目排行榜 🔥
人工智能·github
宝桥南山1 天前
AI - 在命令行中尝试一下ACP(Agent Client Protocol)通信
microsoft·微软·github·aigc·copilot