We will be using GitHub for all the coding assessments in this course. This includes 3 parts:
- accepting the assignment, then
- downloading the starter files to your computer, and finally
- uploading your completed assignment.
Let's look at each of those 3 parts. Each is demonstrated with an animated GIF, which is followed by written instructions of the same. If any of this is not accessible enough, please let me know!
- Find your assignment on Moodle, and click on the link that starts with classroom.google.com.
- The first time you accept an assignment for each course, you'll be invited to select your name from the class list. This connects your GitHub account with your actual human name.
- Click the big green Accept button. This will create a repository for you: a private folder that contains all the starter files for your assignment.
- Click Refresh and you'll see a link to your repo in blue text.
There are a few different ways to do this. You do not need to do all of them, just one!
In order to use this approach, you will need to download Git (which is a system for tracking changes to computer files) as well as GitHub Desktop (an application that makes the Git process a little easier).
- Download Git: https://git-scm.com/downloads
- Download GitHub Desktop: https://desktop.github.com/
- First, open up your repo in a regular internet browser. If you lost the link, you can always click the classroom.google.com link from the previous step, and it'll show you the same blue repo link again.
- Click the big green button that says Code then select Open with GitHub Desktop.
- This launches GitHub Desktop. You can choose where on your computer you'd like to save the contents of this repo. Click Clone, which makes a copy of the repo's contents in that location on your computer.
- Now, you can open it up in your file explorer and view and edit all those files!
Please only use this as a backup in case you're having issues with GitHub Desktop, as this is a manual process.
- First, open up your repo in a regular internet browser. If you lost the link, you can always click the classroom.google.com link from the previous step, and it'll show you the same blue repo link again.
- Click the big green Code button then Download Zip.
- Done. Don't forget to extract (unzip) the file before using its contents!
GIF coming soon: for now, check out this documentation for how to clone using the command line: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository
Once you've made changes, it's time to get those changes on GitHub so your instructor can review them.
- After you've saved your changes, open up GitHub Desktop.
- You should see a little summary of all your changes. Add in a brief description of what you've done (e.g. "submitted final version", "fixed validation bug", etc) then click the blue Commit button. This saves a new version of your entire repo. Then, click Push: this uploads that latest version to GitHub, and you're done!
- To make sure it did upload properly, you can always open your repo in your browser and view your changes there.
- Once you've saved your changes, head over to the Source Control tab within Visual Studio Code.
- Find your project in the list. Add in a brief description of what you've done (e.g. "submitted final version", "fixed validation bug", etc) then click the blue Commit button. This saves a new version of your entire repo. Then, click Sync: this uploads that latest version to GitHub, and you're done!
- To make sure it did upload properly, you can always open it in your browser and view your changes there.
This is not a recommended approach: please only use this manual process as a backup plan.
- Open your repo in a regular internet browser.
- Click the Add File button then Upload Files.
- Select the changed file, then Commit. You're done!
- You can confirm the changes were uploaded by opening the file in your internet browser.
- If you see both the old version of the file as well as the new one, please delete the old one, otherwise you may lose marks on your assignment for having extra files or if the old version is marked instead. Click the file name to open it, then click the menu in the top-right corner and Delete file: .
- Ways to avoid the previous problem are: do NOT change the name of the files after downloading them, and please make sure you're uploading to the same folder you downloaded them from.
GIF coming soon. For now, check out the steps on GitHub: https://docs.github.com/en/repositories/working-with-files/managing-files/adding-a-file-to-a-repository#adding-a-file-to-a-repository-using-the-command-line