Erin's CS stuff

Home Getting Started Topic Explanations Coding Quick Quides

CLI Student Guide

An end-to-end walkthrough of the gh student CLI (already installed in your Development Environment).

The path: log inaccept an assignmentclone and worksubmit.

Before you start

You must have already:

  1. signed up for GitHub
  2. ensured your GitHub username follows the required labsection#-lastname-firstname format
  3. joined the CSE-UNR organization by clicking “accept” in the invitation email
  4. opened a terminal window in your development environment

1. Log in

gh student login

gh_student_auth

This runs gh auth login with the scopes you need. If you skip it, the next command logs you in automatically. gh student logout mirrors gh auth logout.

2. Accept an assignment

gh student accept <org> <classroom> <assignment>

gh_student_accept

Already accepted? The command reports Assignment already accepted and leaves your existing repo (and your work) alone.

If accept fails, see Common gh student accept errors in Troubleshooting.

3. Clone and work

Run the git clone command that gh student accept printed by pressing the Enter key. Edit, commit, and push to your repository’s default branch as usual.

4. Submit

From inside the cloned repository:

gh student submit

gh student submit

This snapshots your current branch and pushes it as a new commit. The autograde workflow runs automatically: it tags the commit submit/<UTC-timestamp>-<short-sha>, grades it, and publishes a GitHub Release with your score a minute or two later.

[!NOTE] On most assignments you can also git push directly — the result is the same. gh student submit exists mainly to pull any teacher-side updates to .gitignore and .github/ from the template before pushing. (For a template-less assignment there’s nothing to refresh, so it just commits and pushes.)

Some assignments grade only on submit (your teacher will say so, and a plain push shows a passing check that says the push was not graded). There, gh student submit pushes the submit/… tag that triggers grading — or tag a commit yourself: git tag submit/final && git push origin submit/final. Any tag under submit/ grades.

Some assignments also name milestone tags (e.g. phase1, phase2, complete — your teacher will tell you). Push one to grade that commit: git tag phase1 && git push origin phase1. The graded result appears as a normal submit/… release.

When submit finishes, it prints two URLs:

Good to know:

What accept does, step by step 1. Auto-accepts any pending organization invitation. 2. Looks up the assignment in the classroom's published manifest. 3. Resolves the autograder workflow. 4. Creates your repository (a template copy, or a new README-initialized repository) — private unless the assignment opts into public repositories, in which case you're warned first. 5. Commits the setup files (`.classroom50.yaml` and the autograde workflow). 6. Opens the Feedback PR, when the assignment enables it. 7. Sets your repo role: `push` for an individual assignment, or `admin` for a group assignment (so a group founder can invite teammates). 8. Prints the `git clone` command.

See also