• 在 GITHUB 搭建免费网站
    Black Skirt 60

    在 GITHUB 搭建免费网站

    The above video is linked to my YouTube channel :

    GitHub is a web-based platform that provides hosting for software development projects using the Git version control system. It is a collaborative platform that allows developers to work together on projects, share code, track changes, and manage software development workflows.

    Key features of GitHub include:

    1. Version Control: GitHub uses Git, a distributed version control system, to track changes to files and manage codebase versions. Developers can create branches, make changes, and merge changes back into the main codebase.
    2. Collaboration: GitHub facilitates collaboration among developers by providing tools for code review, issue tracking, and project management. Developers can discuss code changes, submit pull requests, and address issues through the platform.
    3. Hosting: GitHub provides hosting for Git repositories, allowing developers to store their code and project files in the cloud. Repositories can be public (accessible to anyone) or private (accessible only to authorized users).
    4. Social Networking: GitHub is often referred to as a social network for developers. Developers can follow other users, star repositories, and discover new projects through the platform.
    5. Community: GitHub has a large and active community of developers who contribute to open-source projects, share code snippets, and collaborate on software development projects.
    6. Integration: GitHub integrates with a wide range of third-party tools and services, including continuous integration (CI) systems, code analysis tools, project management platforms, and more.
    7. Documentation: GitHub provides tools for creating and hosting documentation for software projects, including wikis, README files, and project websites.
    8. Education: GitHub offers resources and tools for educators and students, including GitHub Classroom for managing assignments and projects, and GitHub Education for accessing learning materials and resources.

    Overall, GitHub is a powerful platform for software development and collaboration, used by millions of developers and organizations around the world to build, share, and contribute to open-source and proprietary software projects.

    Setting up a website on GitHub Pages is a straightforward process. Here’s a step-by-step guide to get you started:

    Step 1: Create a GitHub Account

    If you don’t already have one, sign up for a GitHub account at github.com.

    Step 2: Create a New Repository

    1. Log in to your GitHub account.
    2. Click on the “+” icon in the top-right corner and select “New repository.”
    3. Choose a name for your repository. If you want to host a personal website, the repository name should be in the format: username.github.io, where “username” is your GitHub username.
    4. Optionally, add a description for your repository.
    5. Choose whether the repository will be public or private (for GitHub Pages, it must be public).
    6. Click “Create repository.”

    Step 3: Set Up Your Website Files

    1. Create a new folder on your computer for your website project.
    2. Add your website files (HTML, CSS, JavaScript, images, etc.) to this folder. Make sure you include an index.html file as the main entry point for your website.

    Step 4: Initialize Git and Push Your Files

    1. Open a terminal or command prompt window.
    2. Navigate to your website project folder using the cd command.
    3. Initialize a Git repository in your project folder:
       git init
    1. Add all your files to the repository:
       git add .
    1. Commit your changes:
       git commit -m "Initial commit"
    1. Link your local repository to the GitHub repository you created:
       git remote add origin https://github.com/username/username.github.io.git

    (Replace “username” with your GitHub username)

    1. Push your files to GitHub:
       git push -u origin master

    Step 5: Enable GitHub Pages

    1. Go to your GitHub repository page.
    2. Click on the “Settings” tab.
    3. Scroll down to the “GitHub Pages” section.
    4. Under “Source,” select “master branch” as the source for GitHub Pages.
    5. Click “Save.”

    Step 6: Access Your Website

    After enabling GitHub Pages, your website will be accessible at https://username.github.io (replacing “username” with your GitHub username). It may take a few minutes for your changes to propagate and for your website to become accessible.

    That’s it! Your website is now hosted on GitHub Pages and can be accessed by anyone with the URL. You can continue to update your website by pushing changes to your GitHub repository.

    你可以使用 GitHub Pages 来搭建免费的静态网站。GitHub Pages 是 GitHub 提供的一个静态网站托管服务,允许用户在 GitHub 上托管并发布自己的网站。

    以下是在 GitHub 上搭建免费网站的基本步骤:

    步骤 1: 创建 GitHub 账户

    如果你还没有 GitHub 账户,你需要先在 GitHub 上注册一个账户。

    步骤 2: 创建仓库(Repository)

    1. 登录 GitHub。
    2. 在右上角的个人菜单中,点击 “Your repositories”。
    3. 在右上角点击 “New” 创建一个新的仓库。
    4. 输入仓库的名称,例如 “username.github.io”(其中 “username” 是你的 GitHub 用户名)。
    5. 选择公开(Public)选项。
    6. 点击 “Create repository” 创建仓库。

    步骤 3: 创建静态网站文件

    1. 在你的计算机上创建一个新的文件夹,并在其中添加你的网站文件,例如 HTML、CSS、JavaScript 文件等。
    2. 在文件夹中创建一个名为 index.html 的文件作为你的网站的首页。

    步骤 4: 将网站文件推送到 GitHub 仓库

    1. 打开命令行界面(如终端或命令提示符)。
    2. 使用 cd 命令导航到你的网站文件夹。
    3. 初始化 Git 仓库:
       git init
    1. 将所有文件添加到 Git 仓库:
       git add .
    1. 提交你的更改:
       git commit -m "Initial commit"
    1. 关联你的本地仓库与 GitHub 仓库:
       git remote add origin https://github.com/username/username.github.io.git

    (请将 “username” 替换为你的 GitHub 用户名)

    1. 推送你的更改到 GitHub:
       git push -u origin master

    步骤 5: 启用 GitHub Pages

    1. 进入你的 GitHub 仓库页面。
    2. 点击 “Settings” 选项卡。
    3. 在页面中滚动到 “GitHub Pages” 部分。
    4. 在 “Source” 下拉菜单中选择 “master branch”。
    5. 点击 “Save” 来保存更改。

    你的网站将会被托管在 https://username.github.io(其中 “username” 是你的 GitHub 用户名)上。

    注意:GitHub Pages 只支持静态网站,不支持服务器端代码(如 PHP)和数据库。



    Note:

    Please subscribe to my YouTube channel Click Me

    If you enjoyed this video, I encourage you to subscribe to my YouTube channel.
    Follow us on My YouTube channel for more details on building WordPress website.
    Copyright ©2026

    Comment

    We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our comment policy .
    Posting comment on "在 GITHUB 搭建免费网站"
    1 2 3 4 5
    Thank you for your comment.

    There is no comment for this post currently,
    be the first one to write a comment.