Windows下搭建GitHub Pages

前期准备:github帐号,登陆https://pages.github.com/。

1. Create a repository:建立仓库

Head over to GitHub and create a new repository named username.github.io, where username is your username (or organization name) on GitHub.

首要步骤是建立一个以你用户名开头的仓库,形如:用户名.github.io

If the first part of the repository doesn’t exactly match your username, it won’t work, so make sure to get it right.

如果仓库名与用户名不匹配,将不会生成页面。

2. Use terminal clone the repository:用终端克隆仓库

Go to the folder where you want to store your project, and clone the new repository:

进入文件夹目录,克隆新仓库,命令:

git clone https://github.com/username/username.github.io

建议安装:RailsInstaller

打开http://railsinstaller.org/下载即可



3. Hello World:建立内容为 hello world 的文件

Enter the project folder and add an index.html file:

进入目录,建立 index.html 文件。

  • cd username.github.io

  • echo "Hello World" > index.html



4. Push it:推送

Add, commit, and push your changes:

执行命令推送至仓库

  • git add --all

  • git commit -m "Initial commit"

  • git push

我在git push的时候,报了个错。

在http://stackoverflow.com/questions/20871549/error-when-push-commits-with-github-fatal-could-not-read-username 找到了解决办法

写成

git push https://<username>:<password>@github.com/<username>/<repository-name>
解决问题。

…and you're done!

完成

Fire up a browser and go to http://username.github.io. Give it a couple of minutes for your page to show up—there will be a delay this very first time. In the future, changes will show up pretty much instantly.

第一次设立页面需要花费几分钟的时间,然后你启动浏览器,访问 http://用户名.github.io。今后修改基本上能立即呈现。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值