Skip to content

Instantly share code, notes, and snippets.

@PawDevUK
Forked from TylerFisher/hosting-on-github.md
Created June 7, 2020 21:57
Show Gist options
  • Save PawDevUK/32a8d5a4297283762d43f6390aa51d41 to your computer and use it in GitHub Desktop.
Save PawDevUK/32a8d5a4297283762d43f6390aa51d41 to your computer and use it in GitHub Desktop.

Revisions

  1. @TylerFisher TylerFisher revised this gist Jun 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hosting-on-github.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    **Hey there, apparently people are still using this Gist from 2012! It's out of date! Consult the [Github docs](https://pages.github.com/).**
    **Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the [Github docs](https://pages.github.com/).**

    ## Steps for Hosting a Website on GitHub

  2. @TylerFisher TylerFisher revised this gist Jun 14, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions hosting-on-github.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    **Hey there, apparently people are still using this Gist from 2012! It's out of date! Consult the [Github docs](https://pages.github.com/).**

    ## Steps for Hosting a Website on GitHub

    1. Create a GitHub account on github.com.
  3. Tyler Fisher revised this gist Aug 1, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions hosting-on-github.md
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,8 @@ You can just leave your website at that address (it'll give you some serious str
    1. Log in to your domain registrar and find where to change your host records. If you don't know, you can usually Google "(domain registrar) change host records", and your registrar will have an explainer telling you how to do it.
    2. Change your domain's A Record to 204.232.175.78. This is GitHub's IP address, which allows GitHub to resolve your URL and serve the correct files.
    3. In your website's directory folder on your computer, create a file called "CNAME". On the first line, type your domain name. Save the file.
    4. In your GitHub application, you should see the file in the left column. Make sure it is checked and click "Sync branches."
    5. Enter your commit message, have it say something like "Adding CNAME file."
    4. In your GitHub application, you should see the file in the left column. Make sure it is checked and enter your commit message. Have it say something like "Adding CNAME file."
    4. Click "Sync branches."

    It can take as long as 48 hours for your domain to resolve to your GitHub page. However, it is usually pretty quick, so check back in an hour or so.

  4. Tyler Fisher revised this gist Aug 1, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions hosting-on-github.md
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,8 @@
    3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
    4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is *very* important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
    5. Move your website's files into the folder that GitHub just created when you made the repository. **IMPORTANT**: Your homepage HTML file must be called "index.html", and it must exist in the top-level directory.
    6. Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, click the "Publish repo" button in the top right corner.
    7. Create a message for your commit
    6. Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, enter a message in the text box called "commit summary", something like "initial commit." Then, click the commit button.
    7. Click the "Publish repo" button in the top right corner.
    8. Give it about 10 minutes, then check your-username.github.io. Your website should be there!

    ## Using a custom domain name
  5. Tyler Fisher created this gist Jul 31, 2013.
    25 changes: 25 additions & 0 deletions hosting-on-github.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    ## Steps for Hosting a Website on GitHub

    1. Create a GitHub account on github.com.
    2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
    3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
    4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is *very* important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
    5. Move your website's files into the folder that GitHub just created when you made the repository. **IMPORTANT**: Your homepage HTML file must be called "index.html", and it must exist in the top-level directory.
    6. Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, click the "Publish repo" button in the top right corner.
    7. Create a message for your commit
    8. Give it about 10 minutes, then check your-username.github.io. Your website should be there!

    ## Using a custom domain name

    You can just leave your website at that address (it'll give you some serious street cred in the developer world), but if you have a custom domain you would like to use, it is very simple to make GitHub redirect your page.

    1. Log in to your domain registrar and find where to change your host records. If you don't know, you can usually Google "(domain registrar) change host records", and your registrar will have an explainer telling you how to do it.
    2. Change your domain's A Record to 204.232.175.78. This is GitHub's IP address, which allows GitHub to resolve your URL and serve the correct files.
    3. In your website's directory folder on your computer, create a file called "CNAME". On the first line, type your domain name. Save the file.
    4. In your GitHub application, you should see the file in the left column. Make sure it is checked and click "Sync branches."
    5. Enter your commit message, have it say something like "Adding CNAME file."

    It can take as long as 48 hours for your domain to resolve to your GitHub page. However, it is usually pretty quick, so check back in an hour or so.

    [1]: http://mac.github.com/
    [2]: http://windows.github.com/