Course Setup
Complete this setup before the first lab. You will install the editor and command-line tools used throughout the course, connect them to GitHub, and practice the workflow for starting and submitting assignments. If you get stuck, bring your computer to class and show me the exact step and error message.
Install VS Code
Install Visual Studio Code and open it. VS Code is the text editor we will use for every assignment. It keeps your files, terminal, and version history in one window.
Open Terminal → New Terminal. The panel that appears at the bottom is a terminal, a text interface for running programs. When an example in this course begins with $, type only what follows the $, then press Enter. The $ represents the prompt and is not part of the command.
Leave VS Code open and follow the instructions for your operating system.
Install Git and Python
macOS
We use Homebrew to install command-line programs in one predictable place. Paste Homebrew’s official installation command into the VS Code terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"The installer explains what it will do and pauses for confirmation. Near the end, it may print one or two commands under Next steps for adding Homebrew to your PATH. Run those commands exactly as printed, then close the terminal with the trash-can icon and open a new one.
Use Homebrew to install Git and Python:
brew install git pythonWindows
In the VS Code terminal, install the maintained Windows build of Git with Microsoft’s Windows Package Manager:
winget install --id Git.Git -e --source wingetIf winget is unavailable, install Git for Windows with its default options instead.
Install the current Python install manager from Python.org or the Microsoft Store. After it installs, run python3 once in a new terminal; the manager installs the current Python runtime when needed. The install manager supplies the python3 command used in course examples.
Completely quit and reopen VS Code after both installations so its terminal receives the updated commands. Then choose Terminal → Select Default Profile → Git Bash and open a new terminal. Git Bash gives Windows the same shell commands used in course examples.
Linux
Use your distribution’s package manager. On Ubuntu, Debian, and related distributions, run:
sudo apt update
sudo apt install git python3 python3-pipFor another distribution, use the corresponding Git, Python 3, and pip packages from its official repositories. Close the terminal with the trash-can icon and open a new one after installation.
Verify the three tools in a new VS Code terminal:
git --version
python3 --version
pip3 --versionEach command should print a version rather than an error. On Windows, if pip3 is not available but the first two commands work, use this equivalent check:
python3 -m pip --versionCreate Your GitHub Account
Create a free personal account at https://github.com/signup and verify its email address. Your username appears on work you publish, so choose one you will be comfortable showing on a resume.
Enable two-factor authentication and save the recovery codes GitHub gives you. Store them in a password manager or another safe place outside your course folders. Do not commit recovery codes to a repository.
Configure Git
Git records a name and email on every commit. In the VS Code terminal, run these commands with your own name and an email listed under GitHub Settings → Emails:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch mainYou may use the GitHub-provided private email shown on that settings page if you do not want a personal address to appear in public history. The final command makes new repositories use main, the branch name used in this course.
Check the saved values:
git config --global user.name
git config --global user.email
git config --global init.defaultBranchConnect VS Code to GitHub
VS Code includes the GitHub support needed to clone, commit, and push. You do not need to install an extension for this everyday workflow.
- Select the Source Control icon in the left Activity Bar. It looks like a branching line.
- Select Clone Repository, then Clone from GitHub.
- Follow the browser sign-in prompts and authorize VS Code, then return to the editor.
- Cancel the repository search after sign-in. You will clone an assignment below.
We will install the GitHub Pull Requests extension later, when the course reaches pull requests.
Use your computer’s file manager to make a folder named csci40 in your Documents folder. This is the parent folder that will hold one separate folder for each assignment. Never clone one assignment inside another assignment’s folder.
Start an Assignment
Assignments begin in one of three ways. The assignment page tells you which path to use.
Start From a Template
Course starter repositories are templates. Creating a repository from a template copies the starter files into a new repository that you own, with one initial commit and history independent of the instructor’s repository. It is not a fork.
For each assignment with starter code:
- Open the starter repository linked from the assignment page.
- Select Use this template → Create a new repository.
- Choose your personal account as the owner, keep the requested repository name, and make it public unless the assignment says otherwise.
- Select Create repository and confirm that its address begins
github.com/<your-username>/, notgithub.com/rtealwitter/. - In VS Code, choose File → New Window if another folder is open. Open Source Control, select Clone Repository → Clone from GitHub, and choose the repository under your username.
- Choose your
csci40folder as the parent location. VS Code creates the assignment folder inside it. - Select Open, then trust the workspace because you recognize the course starter.
Clone your own repository, never the instructor’s template. Cloning also copies the repository’s history and configures where Sync Changes sends your work, so the owner in the URL matters.
If “Use this template” is missing
Use this fallback only when an assignment’s starter does not offer the template button:
On the starter repository, select Code → Download ZIP.
Expand the ZIP, rename its folder to the assignment’s requested repository name, and move it inside
csci40.Open that folder in VS Code, then open Terminal → New Terminal.
Start fresh history with:
git init -b mainOpen Source Control, stage the starter files, enter
start assignmentas the commit message, and select Commit.Select Publish Branch or Publish to GitHub, use the requested name, and publish it to your personal account.
Open the new repository in a browser and verify that the starter files and one initial commit are present.
Do not clone the instructor’s repository and change its remote. Downloading the files and running git init ensures that your repository begins with its own history.
Start an Empty Repository
Some open-ended assignments have no starter files:
- On GitHub, select + → New repository.
- Choose your personal account as the owner, use the name required by the assignment, and make the repository public unless the assignment says otherwise.
- Leave Add a README, Add
.gitignore, and Choose a license unselected, then create the repository. - In VS Code, open Source Control, select Clone Repository → Clone from GitHub, and choose the empty repository under your username.
- Choose
csci40as its parent folder, open the new folder, and create the files named by the assignment.
Publish an Existing Folder
Occasionally an earlier reading or lab has already created the assignment folder on your computer:
- Open that folder in VS Code and select Source Control.
- If VS Code offers Initialize Repository, select it. If the folder already has a repository, skip this step.
- Stage the intended files, enter a short initial commit message, and select Commit.
- Select Publish Branch or Publish to GitHub, use the repository name required by the assignment, and publish it to your personal account.
- Open the new repository in a browser and verify that its owner, files, and initial commit are correct.
Save and Submit Your Work
Save, Commit, and Sync
A commit is a named snapshot in a repository’s history. When you are ready to save a working step to GitHub:
- Save every edited file. An unsaved VS Code tab shows a dot instead of an X.
- Open Source Control and review every file under Changes.
- Do not commit unrelated downloads, passwords, API keys, or recovery codes.
- Select the + beside each intended file to stage it.
- Enter a short message describing the snapshot, then select Commit.
- Select Sync Changes to push the commit to GitHub. Approve the browser sign-in if asked.
- Refresh your repository on GitHub and confirm that the commit and files are visible.
A commit that exists only on your laptop cannot be graded. Make another commit whenever you complete a meaningful step or fix a failed test.
Submit on Gradescope
GitHub Actions can provide quick public feedback, but the instructor-owned checks on Gradescope determine the grade.
- Open Gradescope in a regular browser, not inside an LMS frame, and open the assignment.
- Choose GitHub as the submission method. The first time, link and authorize your GitHub account.
- Choose the repository and branch containing the commit you want graded, then submit.
- Read the named test results. Fix failures in VS Code, save, commit, and sync again.
- Return to Gradescope and resubmit the new commit.
Gradescope grades a snapshot. Pushing another commit to GitHub does not update an earlier submission automatically. Unless an assignment says otherwise, you may repeat this loop until every required test passes.
Troubleshooting
A version command says “command not found.” Completely quit and reopen VS Code, then open a new terminal and try again. On macOS, also run the Next steps commands printed by the Homebrew installer.
python3 works but pip3 does not on Windows. Use python3 -m pip wherever an instruction uses pip3. Both forms run pip for the same Python installation.
VS Code says Git is missing. Verify git --version in a new terminal, then completely restart VS Code.
Your repository does not appear under Clone from GitHub. Confirm that you are signed into the correct GitHub account and that the repository URL begins with your username.
Sync reports that you do not have permission. You probably cloned the instructor’s starter instead of your repository. Return to Start an Assignment, create your own repository from the template, and clone that copy.
A browser does not show your latest edit. Save the file in VS Code, then reload the browser.
Gradescope shows old files. Confirm that the new commit is visible on GitHub, then submit that commit again on Gradescope.
If none of these fixes applies, bring the computer to class or post the exact command, complete error message, and the step you were following on Discord.