📌 What is Git?
Git is a version control system that helps you track changes in your code, collaborate with others, and manage different versions of your project. It allows you to:
- Save your code history
- Work with others on the same project without conflicts
- Revert to previous versions if something goes wrong
- Deploy your project to platforms like GitHub Pages
📌 Why Use GitHub Pages?
GitHub Pages lets you host static websites (HTML, CSS, JavaScript) directly from your GitHub repository — completely free, no servers needed.
Step 1: Create a GitHub Repository
Go to GitHub → Click New →
Name your repo (e.g., mywebsite.github.io
) → Set it to Public → Click Create Repository.
Step 2: Add Your Website Files
Put your index.html
, style.css
, and other files into the local folder.
Step 3: Push to GitHub
git init git add . git commit -m "Initial commit" git branch -M main git remote add origin https://github.com/yourusername/mywebsite.github.io.git git push -u origin main
Step 4: Enable GitHub Pages
Go to your repo → Settings → Pages →
Select branch main
and folder root
→ Click Save.
Step 5: Visit Your Website
Wait a minute and open:
https://yourusername.github.io