In this classwork you will practice using Git/Github from the terminal along with the Google Chrome development console.
-
Change to the directory
~/CodeSchool
-
Create a new subdirectory under
~/CodeSchool
calledscratch/git
-
Change to the
~/CodeSchool/scratch/git
directory -
Create a new local git repository
-
Create a new file called
index.html
using thetouch
command -
Open
index.html
in Visual Studio Code and copy/paste code below (don't forget to save):<!DOCTYPE html> <html> <head> <title>Sample HTML/JavaScript</title> </head> <body> <script> let x = '2', y ='2'; let msg_overkill = `I'd love ${x} try ${y} code something up for the platform`; console.log(msg_overkillit); </script> <h1>Top Header for a Sample HTML Page!</h1> </body> </html>
-
Stage the new file to your local git repository (hint: add)
-
Commit your changes to the git repository with the message
Initial checkin of index.html
-
Login to your Github account and create a new remote repository called
scratch_remote_repo
-
Back on your local machine, add your existing project files to your new Github remote repository
-
Push your
index.html
file to your new remote repository -
Open
index.html
in the Chrome web browser -
In Chrome, display the developer console
-
Use the developer console to find the JavaScript error
-
Fix the error in Visual Studio Code (reload and test in the browser!)
-
Use the git command to check the status of changes
-
Use the git command to view the differences between your current
index.html
and the prior version -
Stage the modified
index.html
to your local git repository -
Commit your changes to the git repository with the message
Fixed variable reference in JavaScript
-
Push your modified
index.html
file to your remote Github repository -
Pull up your remote Github repository in the browser, verify the changes were committed
-
View the diff in Github and capture a print screen of the differences (hint: PrtSc)
-
Add the screen capture image to this git assignment repository
-
Commit and push the changes to this git assignment repository