Speaking
Speaking
GitHub, and how to push code from Visual Studio Code to GitHub.
First, visit the page github.com. If you don't have an account, click “Sign up”. I
already have an account, so I'll click “Sign in”.
Next, we need to enter the email and password we registered with to log in to the
account and click enter.
Next, click the “+” button in the top right corner and select “New repository”. Name
the repository (for example, I will name it “my-website”). Then, click “Create
repository”. Ok.
Next, I will show you how to push code from Visual Studio Code to GitHub. First, we
need to open Visual Studio Code. Then, click “File”. Note that if you want to push an
HTML file, select “Open File”; if you want to push a folder, select “Open Folder”.
Here, I want to push a folder, so I will choose “Open Folder”. Next, select the folder
you want to push and click “Select Folder”. That's it!
Click “Terminal” in the left corner of the screen, select 'New Terminal', and enter the
following command: “git remote -v”. Then, type “git init” and press Enter. Next, go
back to the GitHub page, copy the command near the bottom, and paste it into the
terminal. Press Enter. Then, type “git add .” . Next, type “git commit -m "my
website"”. Inside the quotation marks, you should type the commit message you want
to send to GitHub. For example, here I will type my website and press Enter. After
that, type “git push -u origin main”. If you get an error like this, it's because you
haven't declared a branch yet. I will declare a branch for it by typing “git branch -m
main” and pressing Enter. Then, I will re-enter “git push -u origin main”. Next, I will
return to the GitHub page and refresh the page. As you can see, I have successfully
pushed the code.
Finally, select 'Settings' in the middle of the screen, scroll down to the 'Pages' section
in the left sidebar. In the 'Branch' section, select 'main' and click 'Save'. Wait a moment
for a green checkmark to appear; that means it's done. If you want to get the link to
see if the website is running, select 'Actions', then select 'pages build and deployment'.
In the 'deploy' branch, there is a link; just click on the link.
Thank you for watching my entire video.