中文 / English
Stay Curious.

Walking slowly under the sky of knowledge


  • Home

  • Archive

  • About

  • Page404

  • Search

Setup the first GitHub Page

Published at: 2021/11/23   |   Categories: Blog   Web   | Words: 473 words | Reading: 1 minutes | Visited:

Let‘s talk about how to setup a github page.

This is my method :

  1. Register inGitHub.

  2. Create a repository。

    单击创建仓库按钮

    The name of the repository should be same as your user name.

    创建仓库

  3. Install git in your PC.

    then config your name and email:

    $ git config --global user.name "Jasmine"
    
    $ git config --global user.email "123456@qq.com"
    
  4. Create a SSH Key,and config it to GitHub.

    1. Run ssh-keygen in your PC.

      Please use your own email:

    $ ssh-keygen -t rsa -C “123456@qq.com”

    
    
    2. Config the key to GitHub.
    
    ![创建SSH密钥](//jasmine617.github.io/post/images/20211123003.png)
    
    
    ![配置密钥](//jasmine617.github.io/post/images/20211123004.png)
    
    
    
    
  5. Clone the repository from GitHub.

    1. Get the URL of your repository:

      获取仓库URL

    2. Create a folder in your PC, then open the Git Bash and excute.

      Please use your own URL:

      $ git clone git@github.com:Jasmine617/jasmine617.github.io.git
      Cloning into 'jasmine617.github.io'...
      warning: You appear to have cloned an empty repository.
      

      or:

      $ git clone https://github.com/Jasmine617/jasmine617.github.io.git
      
  6. Create index.html and commit to git in your PC.

    1. After clone, you will fine a new folder. Enter, then Create index.html,

      This is a example:

      <!DOCTYPE html>
      <html lang="en">
      <head>
          <meta charset="UTF-8">
          <title>my first blog</title>
      </head>
      <body>
      <p>hello world</p>
      </body>
      </html>
      
    2. Commit the file in Git Bash.

      $ cd jasmine617.github.io
      $ git add --all
      $ git commit -m "test commit index.html"
      
  7. Pull the file to your GitHub repository.

    1. check your git status.

      $ git status
      On branch main
      Your branch is up to date with 'origin/main'.
      
      nothing to commit, working tree clean
      
    2. pull it to your GitHub repository.

      $ git push origin main
      Enumerating objects: 3, done.
      Counting objects: 100% (3/3), done.
      Delta compression using up to 8 threads
      Compressing objects: 100% (2/2), done.
      Writing objects: 100% (3/3), 338 bytes | 338.00 KiB/s, done.
      Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
      To https://github.com/Jasmine617/jasmine617.github.io.git
       * [new branch]      main -> main
      
  8. Check your GitHub Page。

    1. Check whether the index.html is in repository.

      检查上传结果

    2. Check the GitHub Page Configuration.

      页面设置

    3. Open your GitHub Pages.

      创建结果

#GitHub Pages#
QQ QrCode

Declaration:Setup the first GitHub Page

Link:https://jasmine617.github.io/en/post/setup-helloworld/

Author:Jasmine

Declaration: This blog post article is under the CC BY-NC-SA 3.0 license,Please indicate the source!

If it can help you, you can give tips for blogger that how much you want. ^_^
WeChat Pay

Wechat Pay

Jasmine

Jasmine

Keep thirst for knowledge and learning ability!

1 Blogs
2 Categories
1 Tags
GitHub CSDN
Links
  • LiaoXueFeng
  • Elkan.Li
TagCloud
  • Github pages
© 2010 - 2022 Stay Curious.
0%