Head over toGitHub andcreate a new public repository namedusername.github.io, whereusername 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.
GitHub Desktop is a great way to use Git and GitHub on macOS and Windows.
Download GitHub DesktopGo to the folder where you want to store your project, and clone the new repository:
~$git clone https://github.com/username/username.github.io
Click the "Set up in Desktop" button. When the GitHub desktop app opens, save the project.
If the app doesn't open, launch it and clone the repository from the app.
After finishing the installation, head back to GitHub.com and refresh the page. Click the "Set up in Desktop" button. When the GitHub desktop app opens, save the project.
If the app doesn't open, launch it and clone the repository from the app.
Enter the project folder and add an index.html file:
~$cdusername.github.io
~$echo "Hello World" > index.html
Grab your favorite text editor and add an index.html file to your project:
<!DOCTYPE html><html><body><h1>Hello World</h1><p>I'm hosted with GitHub Pages.</p></body></html>
Add, commit, and push your changes:
~$git add --all
~$git commit -m "Initial commit"
~$git push -u origin main
Enter the repository, commit your changes, and press the publish button.
Fire up a browser and go tohttps://username.github.io.
You have the option to start with one of the pre-built themes,
or to create a site from scratch.
Head over toGitHub.com and create a new repository, or go to an existing one.
Click on the Settings tab.
Scroll down to theGitHub Pages section. PressChoose a theme.
Choose one of the themes from the carousel at the top.
When you're done, clickSelect theme on the right.
Use the editor to add content to your site.
Enter a commit comment and click onCommit changes below the editor.
Head over toGitHub.com andcreate a new repository, or go to an existing one.
Click on theCreate new file button.
Name the fileindex.html
and type some HTML content into the editor.
Scroll to the bottom of the page, write a commit message, and commit the new file.
Click on the Settings tab and scroll down to the GitHub Pages section.
Then select themain branch source and click on theSave button.
Fire up a browser and go tohttp://username.github.io/repository.
UsingJekyll, you can blog using beautiful Markdown syntax, and without having to deal with any databases.Learn how to set up Jekyll.
Want to use your own custom domain for a GitHub Pages site? Just create a file named CNAME and include your URL.Read more.
Learn how to create custom 404 pages, use submodules, andlearn more about GitHub Pages.