Headlines

Here are amazing steps for Hosting a Website on GitHub:

Share tech-trends
  1. Create a GitHub Account:
    • Go to GitHub and sign up for an account.
  2. Download GitHub Desktop:
    • Download and install GitHub Desktop for your operating system (Windows or Mac).
    • Open the app and log in using your new GitHub account.
  3. Configure GitHub (for Mac Users):
    • After logging in, click “Advanced” to verify your name and email settings.
    • Optionally, click “Install Command Line Tools” to enable command-line access for future use.
  4. Create a New Repository:
    • In GitHub Desktop, create a new repository with the name your-username.github.io (replace “your-username” with your GitHub username).
    • Take note of the folder where the repository is saved. Ensure the “Push to GitHub?” option is checked.
  5. Add Website Files:
    • Move all files for your website into the new GitHub repository folder created in the previous step.
    • Important: Your main HTML file must be named index.html and should be in the top-level directory.
  6. Commit Changes:
    • In GitHub Desktop, check that all website files are listed in the left column.
    • Enter a commit message like “Initial commit,” then click “Commit to main.”
  7. Publish the Repository:
    • Click “Publish repository” in the top-right corner of GitHub Desktop.
  8. View Your Website:
    • After a few minutes, go to your-username.github.io to see your live website!

Setting Up a Custom Domain (Optional)

  1. Configure Domain Settings:
    • Log in to your domain registrar and find the settings to update host records. Look up “(your domain registrar) change host records” if you’re unsure.
  2. Update A Record:
    • Change your domain’s A Record to 204.232.175.78 (GitHub’s IP address) to direct your custom domain to GitHub’s servers.
  3. Add a CNAME File:
    • In your local repository folder, create a file named CNAME.
    • Inside the file, type your custom domain (e.g., www.yourdomain.com), and save it.
  4. Commit and Sync Changes:
    • In GitHub Desktop, you should see the new CNAME file. Enter a commit message like “Adding CNAME file” and click “Commit to main.”
    • Click “Push origin” to sync the changes.
  5. Wait for the Domain to Resolve:
    • It can take up to 48 hours for the domain to point to your GitHub site, though it usually resolves faster. Check back periodically to confirm.
shadjavist
Author: shadjavist

Humble gentleman who never believes in impossibility

Leave a Reply

Your email address will not be published. Required fields are marked *