Post Homework to GitHub

Reference - New Project Upload

For a project that has not been uploaded before:

  • Open File Explorer to find the project so you can see where the project files are located

  • Open Git Bash - navigate to the desired directory using the cd command. Use quotes or escaping for names of files with spaces. Example:

  • cd c:

  • cd "100Dev Classes"

  • cd class12-materials

  • cd class12-materials (don't ask me why I organized my files that way - my future me will be more aware of file and subfile names going forward)

  • cd "background-picker - Maria Midkiff"

  • Git Bash: git add Now I am at the directory I want to upload. Use the following command to initialize the repository: git init then Enter

  • My version shows (master) at the end. Change it to main. Type: git branch -M main then Enter

  • Type: git add . then Enter

  • Type (including the quotes): git commit -m "describe what this commit is about" then Enter

  • Next, open Github, and create a new repository by clicking the green button top right of the screen

  • Github: Name the repository, don't change any other options on the page

  • Github: Click Create Repository green button at the bottom of the page

  • The repository screen pops up. After the above steps, we only need the last two items from the box "...or create a new repository on the command line" of

    • git remote add origin..... and

    • git push..... So, go back to Git Bash and type the first line git remote.... in the command line:

  • git remote add origin <name of repository> looks like:

  • git remote add origin github.com/Maria-Midkiff/background-picker-..

  • Git Bash: Then type git push -u origin main

  • Next, go back to Git Hub

  • Enable Git Hub pages by first going to Settings (top of the page in the middle of the screen), then click on Pages shown on the left side of the screen.

  • Under the Branch subheading, click the drop-down on the None button

  • Select main, and don't change any other options

  • Under the Branch subheading, click the Save button

  • F5 page. It may take a minute to update, but after F5, will show the site updated to have a Visit site button at the top to see the site live.