This is the lab support repository for the Fall 2020 version of INST377.
The following steps are to do the following:
At the end of these instructions, your github pages repository should look like a copy of this repository. You can then work on your labs locally, push to your own remote, and pull changes I make here into your repos without wrecking your work.
It’ll be great! But it is tricky to get there.
npm install
in that window.So: First, get set up with Github Pages by following the instructions present here: https://pages.github.com/
In your terminal window, in your copy of this repository (folder) - it should be called “INST377-FA2020”:
git remote -v
- this will list all the remote places you can save your code.
origin https://github.com/aleitch1/INST377-FA2020
git remote rename origin classfiles
git remote -v
and confirm you now have one remote, called “classfiles”https://github.com/YOUR-GITHUB-USERNAME/YOUR-GITHUB-USERNAME.github.io.git
.git
at the end specifies it is a repository and not a webpagegit remote add origin [THE LINK YOU JUST FOUND]
and hit enter.git remote -v
and check that you have two possible remote repositories: the course repo, and your Github Pages repo.git pull origin master
- it won’t WORK because you have two different histories, but it will clear related problems.git push origin master --force-with-lease
--force-with-lease
is like saying “Do it now but don’t overwrite any serious local changes.”git push origin master --force
, but it will blow away all changes on your remote. Use with caution.https://github.com/your-username/your-username.github.io
- a bunch of lab files should be there.https://YOUR-GITHUB-USERNAME.github.io/public/lab_1/index.html
It will not let you keep tabs on both remotes at once, there’s a four-year-long conversation on the topic available below if you care. Link For Reference: Github Desktop supports only one remote
To set your repository remote (where you publish code to) in GH Desktop
git remote -v
should output this:
classfiles https://github.com/aleitch1/INST377-FA2020.git (fetch)
classfiles https://github.com/aleitch1/INST377-FA2020.git (push)
origin https://github.com/your-username/your-username.github.io.git (fetch)
origin https://github.com/your-username/your-username.github.io.git (push)
/public/lab_1/index.html
file.Back in the VSCode terminal in your repository, type git pull origin master --allow-unrelated-histories
git remote add classfiles https://github.com/aleitch1/INST377-FA2020.git
so you can pull updates from the class repository.You will need to pull from the class repository periodically as we go through the semester, though hopefully not for the first few weeks. To do this, in VSCode:
git pull classfiles master
, and you should have the updated files.