GitHub Pages
You get one site per GitHub account and organization,
and unlimited project sites. Let‘s get started.
-
Create a repository
Head over to GitHub and create a new public repository named username.github.io, where username is your username (or organization name) on GitHub.
If the first part of the repository doesn’t exactly match your username, it won’t work, so make sure to get it right.
-
What git client are you using?
-
Clone the repository
Go to the folder where you want to store your project, and clone the new repository:
~$git clone https://github.com/_username_/_username_.github.io
-
Hello World
Enter the project folder and add an index.html file:
~$cd username.github.io
~$echo "Hello World" > index.html
-
Push it
Add, commit, and push your changes:
~$git add --all
~$git commit -m "Initial commit"
~$git push -u origin main
-
…and you're done!
Fire up a browser and go to https://username.github.io.
Now that you’re up and running, here are a few things you should know.
-
Blogging with Jekyll
Using Jekyll, you can blog using beautiful Markdown syntax, and without having to deal with any databases. Learn how to set up Jekyll.
-
Custom URLs
Want to use your own custom domain for a GitHub Pages site? Just create a file named CNAME and include your URL. Read more.
-
Guides
Learn how to create custom 404 pages, use submodules, and learn more about GitHub Pages.