I use GitHub to get a website online

There's a few ways. 1 is to use GitHub Pages

https://pages.github.com/

Another is if you started in VSCode

In GitHub, create a new repository

Name it, clone, copy url

Go to command line (cmd space search terminal)

Make sure you start on your desktop (cd desktop) and then navigate to the folder you want to be (cd code ) and then your project folder

type: git clone and paste the url. Should show as cloned and done. Type ls to see it on your desktop Type cd filename then ls to see what’s in the file (a readme)

Open your code editor and then open the folder you just created Start coding in that file. If you’ve already been coding in another file, then you have to drag it into your cloned file.

Then type git status in your terminal to see

Type git add index.html to add that file

But its not committed, so type git commit -m “initialize main webpage”

Git push origin main


Then go refresh on GitHub and you should see the index added (initialized)


-Now make a branch,

so in terminal: git checkout -b BRANCH-NAME (minute 33 on video)

-You add a branch when you want to explore changes but not yet commit them to the main, esp if someone else needs to review them first;

On GitHub/finishing making a branch

-Click on the new branch in the dropdown menu and you can see your changes. But if you go to the main branch, you’ll see your changes not yet made.

  • -Now we need to create a pull request so click Pull Request on the top menu bar, and then describe changes, and click the green button Create Pull Request midway down the page.
  • -I had a conflict and I was able to merge it
  • -then I clicked merge pull request
  • -confirm merge requsest
  • Go back to terminal. You have to get these changes on your code editor too. Soon our terminal, go to main:
  • -git checkout main
  • -git pull

  • FINISHED

    To make updates without making a pull request


    But what about getting it online?

    This requires buying a domain name and configuring a DNS which is like- SO CONFUSING So standby bc i'm figuring it out still.

    I know it involves GitHub Pages, and the DNS tab of google domains

    Go here: https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages