怎么把自己做的网页托管在github上

  • 没有域名和服务器的前提下,怎么可以访问到我们的网页呢?
    可以把网页代码托管在github,同样可以以站点的方式访问。
    实践网址示例:
    https://411forget.github.io/shufa.github.io/

1、准备条件

  • 注册一个github账号
  • 安装Git
  • 在github创建一个存储库,用来存放我们页面的相关代码文件
    存储库

2、git的操作方法

or create a new repository on the command line
echo "# yufa.github.io" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:411forget/shufa.github.io.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin [email protected]:411forget/shufa.github.io.git
git push -u origin master
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
Import code

3、将本地网页的所有代码文件都push到github上

*注意:将需要将主页的html文件命名为index.html*

push到git

最后的文件全部push上去的效果如下:
网页所有文件

4、现在可以打开网址看一下效果

具体网址是什么?
网址哪里有
网址哪里有

如果打不开网址:可能是pages还是none的状态,自己设置下即可
网址设置

网址打开后的效果图:
书法网址

猜你喜欢

转载自blog.csdn.net/qq_35061334/article/details/81188651