创建自己的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
相关推荐
码流怪侠14 小时前
【GitHub】WorldMonitor:一个工程极致主义的实时全球情报仪表盘深度解析
github
北极糊的狐18 小时前
20.3 使用 Vercel CLI 手动部署(无需 GitHub,适合不常更新的项目)
github
2401_8534482318 小时前
Git安装流程和基础使用步骤
git·github
官乐19 小时前
Github创建上传仓库流程
github
tokenKe20 小时前
Buzz:蜂巢意识协作平台|Agent 不是 Bot,而是持有独立密钥对的团队成员|SSP Github Daily
github
zdkdchao21 小时前
建立gitee对github仓库的镜像
gitee·github
小弥儿21 小时前
GitHub 今日热榜 | 2026-07-24:金融 K 线基础模型上榜
学习·金融·开源·github
FII工业富联科技服务1 天前
灯塔用例解析:AI服务器柔性自动化制造体系的四大核心能力
github
lazy H1 天前
从入门到日常开发,一篇文章掌握 Git 核心操作
git·后端·学习·github
zzqssliu1 天前
煤炉自动代拍系统的队列设计与超时控制机制
git·github