Transform your local website into a live one using GitHub Pages - completely free! This guide takes you from zero Git knowledge to having your first website online.
Table of Contents
- What is GitHub?
- Creating a GitHub Account
- Creating Your First Repository
- Uploading Your Website Files
- Enabling GitHub Pages
- Conclusion
What is GitHub?
GitHub is like a cloud storage service specifically designed for code. Think of it as Google Drive for developers, but with superpowers! π¦ΈββοΈ
Fun Fact: GitHub hosts over 200 million repositories and is used by more than 73 million developers worldwide!
It's a platform where you can:
- Store your code securely in the cloud
- Share your work with others
- Host websites for free using GitHub Pages
- Track changes to your code over time
The best part? You don't need to be a professional developer to use it!
Creating a GitHub Account
Let's get you started with your very own GitHub account! π
Step-by-Step Guide:
- Visit
github.com
- Click the "Sign Up" button in the top-right corner
- Enter your email address
- Create a strong password
- Choose a username - this will be part of your website's URL
- Verify your account through the email you'll receive
- Optional: Add a profile picture and bio
Pro Tip: Choose your username wisely - your website's URL will be
username.github.io
Creating Your First Repository
A repository (or "repo") is like a project folder that will contain all your website files.
Creating Your Repository:
- Click the "+" icon in the top-right corner of GitHub
- Select "New repository"
- Name: username.github.io
- Visibility: Public
- Initialize with: README file
- Click "Create repository"
Important: The repository name must exactly match your GitHub username followed by
.github.io
Uploading Your Website Files
Now comes the exciting part - uploading your website! π¨
Required Files:
index.html
- Your main webpage
<!DOCTYPE html> <html> <body> <h1>My Website</h1> <p>My paragraph.</p> </body> </html>
style.css
- Your styling file (optional)script.js
- Your JavaScript file (optional)- Any images or other assets
Upload Steps:
- Inside your repository, click "Add file" β "Upload files"
- Drag and drop your files into the upload area
- Scroll down to "Commit changes"
- Add a message: "Initial website files upload"
- Click "Commit changes"
Remember: Your main HTML file must be named
index.html
Enabling GitHub Pages
Time to make your website live! π
Activation Steps:
- Go to repository Settings
- Find "Pages" in left sidebar
- Under "Source":
- Select "Deploy from a branch"
- Choose "main" branch
- Set root folder: "/(root)"
- Click "Save"
Note: It might take up to 10 minutes for your site to appear. Be patient!
Conclusion
π Congratulations! Your website is now live at https://username.github.io
What's Next?
- Get a free portfolio website for you from PortLoom
- Make your online presence
- Learn more on portfolio websites from the ultimate guide to creating your portfolio with portloom
- Experiment with different HTML, CSS, and JavaScript features
Quick Tip: Bookmark your repository URL for easy access to update your site in the future!
Stay Updated!
Happy coding, and don't forget to hit the follow button for more beginner-friendly tutorials and web development guides! π