Git and Github
Housekeeping
- CPNT 201 Assignment 1 Announced
- FreeCodeCamp HTML/CSS exercises will eventually be for marks if you’re bored this weekend. Important: make sure you create an account and sign-in so your progress is saved.
See: Terminology
Starting project
Find a project in [sample-code] (or use one of your own) that is a static website with an index.html
file in the root directory. You can use this as a sample project for the below exercises.
Complete the following
- First Time Setup
- Cloning a read-only repo
- Initializing a new local repo
- Committing changes to a local repo
- Create and sync a remote repo
- Push commits to a remote repo
End of day goal: Publish a website to GitHub Pages
Once you’ve completed the above steps and pushed a static website to GitHub, try publishing it on GH Pages.
Prerequisites
- Remote repo with an
index.html
in the root directory. - If you’re publishing your user website (i.e. not one of your repos) your repo must be named
<username>.github.io
.
Enabling GH Pages
- Go to the Settings tab of the repo.
- Scroll down to the “GitHub Pages” section.
- Select Source as
main
(it’s sometimesmaster
) and/root
. - Save your changes.
- Wait a few minutes and your website should be live at
<username>.github.io/<repo-name>
(or just<username>.github.io
if it’s your user site).
Paste your published site in #winter-2021
and you can go hoooooome at lunch!