Embracing the power of version control and collaboration, GitHub has become an essential platform for web developers. If you've created an HTML website and want to leverage GitHub's features, you're in the right place. This guide will walk you through the process of adding your HTML website to GitHub, ensuring your code is safely stored and easily shareable.

Before we dive in, make sure you have the following: a GitHub account, your HTML website files, and a basic understanding of Git and GitHub. If you're new to Git, don't worry; we'll keep it simple and focus on the essentials.

Setting Up Your GitHub Repository
Your first step is to create a repository on GitHub where your HTML website will live. A repository, or repo, is essentially a project folder that stores all your files and tracks changes over time.

To create a new repository:
- Log in to your GitHub account.
- Click the '+' icon in the top-right corner and select 'New repository'.
- Name your repository (e.g., 'my-website'), write a short description, and then click 'Create repository'.

Initializing Git Locally
Now that you have a repository on GitHub, it's time to initialize Git on your local machine. This will allow you to track changes to your HTML files and push them to your GitHub repository.
Open your terminal or command prompt, navigate to your website's root directory, and type the following commands:

git init
git add .
git commit -m "Initial commit"
Connecting to GitHub
Next, you'll connect your local repository to your GitHub repository. This allows you to push your local changes to the cloud.
First, copy the repository URL from your GitHub repository page. It should look something like this: https://github.com/yourusername/your-repo.git. Then, run the following command in your terminal:

git remote add origin your-repo-url
Pushing Your HTML Website to GitHub
Now that everything is set up, you can push your HTML website to GitHub. First, make sure all your files are added and committed:



















git add .
git commit -m "Adding website files"
Then, push your changes to the GitHub repository:
git push -u origin main
If you're asked for your GitHub credentials, enter them, and your HTML website files should now be uploaded to your GitHub repository.
Verifying Your HTML Website on GitHub
To ensure your website is successfully added to GitHub, visit your repository page on GitHub. You should see your HTML files listed. Click on one of your HTML files to view it. If everything is set up correctly, you should see a 'Raw' button. Clicking this button should display the raw HTML content of your file.
To view your website as it would appear in a browser, you can use GitHub Pages. Click on the 'Settings' tab in your repository, scroll down to the 'GitHub Pages' section, and select the 'main' branch. Your website should now be live at https://yourusername.github.io/your-repo/.
Congratulations! You've successfully added your HTML website to GitHub. This means your code is now backed up, easily shareable, and ready for collaboration. Happy coding!