Tutorial 11: Practise GitHub safely
Goal: get comfortable with GitHub in QUILL or QUILL Lite by working on a practice project where nothing you do can go wrong. You'll read a real-looking project, make a copy of your own, and then review, comment, merge and fix a failing check in it.
This lesson works the same in QUILL and QUILL Lite. Where the two differ, both are given. It takes about twenty minutes, plus as long as you like afterwards.
What you're practising on
Community Access keeps a practice repository on GitHub, Community-Access/quill-github-practice. It holds a tiny Python project called Tally, which counts the words in some text. The code hardly matters. What matters is everything around it, already set up for you:
- six issues, with labels, an assignee, a milestone and a closed one;
- a pull request, "Add a line count", with a review that has a line comment and a suggested change;
- a draft pull request, "Speed up word counting", whose check fails on purpose;
- a release,
v0.1.0, with a file attached; - a discussion with replies;
- a security policy, a code of conduct, and issue and pull request templates.
The practice repository is the example everyone reads, so it's locked: you can read everything in it, but only Community Access can change it. Everything you do that writes something happens in your own copy, which you make in part 2. Nobody else sees your copy unless you want them to, and you can delete it when you're done.
What you need
- A GitHub account. A free one is fine.
- QUILL or QUILL Lite, signed in to that account. If you haven't
signed in yet: in QUILL, choose File > Open from Remote >
Manage GitHub Accounts.... In QUILL Lite, choose File
> Manage GitHub Accounts... (
Alt+F, thenH). The GitHub Guide's chapter 1 explains signing in. - In QUILL, GitHub Remote Access, which is on in most profiles. If the
GitHub rows aren't on the File menu, turn it on in Profiles and
Features..., or press
Alt+Shift+Pand choose Developer. - If you like, View > GitHub Workbench Mode
(
Alt+V, thenK). It puts everything this tutorial uses in one GitHub menu (Alt+G), in both apps. The steps below give both routes.
1. Read the practice repository
- Open GitHub Items. In QUILL, choose File > Open from
Remote > GitHub Items.... In QUILL Lite, choose File
> GitHub Workbench... (
Alt+F, thenG). In workbench mode, in either app, choose GitHub > Repository Items... (Alt+G, thenT). - In Repository:, type
Community-Access/quill-github-practiceand press Enter. The issues load. - Arrow to "Word count is off by one when text ends with a space" and press Enter. Read it from the top. It has one comment, suggesting the fix.
- Go back to the list and open "Question: what counts as a word?".
Press
Alt+Nto move from comment to comment, andAlt+Pto go back. - Switch View: (
Alt+I) to the pull requests and open "Add a line count". You hear its one-sentence summary first. - Open it in the review window. Move through the outline, then from
thread to thread. One thread has a suggested change: it shows what the
reviewer thinks
line_countshould say instead.
That's the read-only part. Everything you just did works in any public repository, signed in or not.
2. Make your own copy
The practice repository is a template, which means GitHub can make a fresh copy of it for you, with its own history.
- In GitHub Items, press
Alt+Efor Explore.... - In Repository: (
Alt+R), typeCommunity-Access/quill-github-practiceand load it. - Open the context menu (the Applications key, or
Shift+F10), then the Repository Actions for Community-Access/quill-github-practice submenu, and choose Create Repository from This Template.... - Name it, say
my-github-practice. Leave the organization empty so the copy goes in your own account. It can be private if you'd rather nobody saw it. - Confirm. When it's made, QUILL says so.
If you'd rather use the web: on the practice repository's page, choose Use this template, then Create a new repository.
3. Fill your copy with practice items
GitHub copies the files, but not the issues or pull requests. Your copy comes with a workflow called Set up practice that makes them.
First, two settings, once. These are on GitHub's website, in your copy's Settings:
- Settings > Actions > General > Workflow permissions: check Allow GitHub Actions to create and approve pull requests, then choose Save.
- Settings > General > Features: check Discussions.
Then run the workflow from QUILL:
- In GitHub Items, load your copy, such as
your-name/my-github-practice. - Set View: to Workflows.
- Select Set up practice and press Enter, or choose
Run Workflow on Branch... from its context menu. Keep
mainas the branch and confirm. You hear "Dispatched". - Set View: to Workflow Runs. After a minute, the Set up practice run says "completed" and "success".
Your copy now has the same issues, pull requests, release and discussion as the practice repository. If you forgot a setting, the run fails instead, and its summary says which setting to turn on. Turn it on and run it again. It never makes anything twice, so you can run it whenever you want a fresh start.
4. Review and merge a pull request
Everything from here is in your copy.
- Open the pull request "Add a line count" in the review window.
- Go to the thread with the suggested change. Reply to it, saying you agree with the suggestion, then resolve the thread.
- Comment on a line of the diff of your own choosing. Your comment waits as pending until you send your review.
- Send your review as a comment.
- Merge the pull request. The issue "Add a line count to the summary" closes by itself, because the pull request said it would.
QUILL doesn't commit a suggested change for you. On GitHub's website, the suggestion has a Commit suggestion button, if you want to try that too.
5. Find out why a check failed
- Set View: to Workflow Runs and
select the failed Tests run for the branch
practice/speed-up-word-counting. Set up practice started it for you. - In your copy, the draft pull request's own check may say it's waiting for approval, because a workflow opened the pull request rather than a person. You don't need it for this part: the run you just selected tested the same code.
- Press
Ctrl+Shift+Wfor What Failed.... You hear how many jobs failed, then the failed step, and then the lines that matter: the testtest_counts_hyphenated_wordsexpected 3 words and got 4. - That's the whole story. The change splits on hyphens, so "screen-reader" counts as two words, and the issue "Question: what counts as a word?" settled that it should be one.
- From the run's Actions... menu, rerun the failed jobs. They'll fail again, of course, because the code hasn't changed. Rerunning is for failures that come from GitHub, not from the code.
6. Work with issues
- Add the label
accessibilityto "CONTRIBUTING should explain how to write a test". - Write a new issue using the Bug report template. It doesn't have to be a real bug.
- Put your new issue in the milestone "Practice milestone 1".
- Close "Typo in the module docstring", then reopen it.
- React to the first comment on "Question: what counts as a word?".
7. Clone your copy
To have your copy's files on your computer, clone it.
- In QUILL, choose File > Open from Remote > Clone
Repository.... In QUILL Lite, choose File > Clone
Repository... (
Alt+F, thenY). In workbench mode, choose GitHub > Clone Repository... (Alt+G, thenC). - In Repository, type your copy's name, such as
your-name/my-github-practice. - In Into this folder, keep the folder QUILL suggests, or choose Browse....
- Press Clone. You hear "Cloning", then "Cloned" when it's done.
- When you're offered a file from the new folder, take it, and open
PRACTICE.md.
Your copy can be private: cloning uses the account you signed in with, and nothing in the new folder keeps your token.
Where to go next
- The practice repository's
PRACTICE.mdhas a set of exercises for every chapter of the GitHub Guide, including releases, discussions, codespaces and the command line. - The GitHub Guide explains every command used here, and many more. It comes with both QUILL and QUILL Lite.
- Tutorial 8: GitHub inside QUILL and QUILL Lite covers opening and saving files on GitHub, managing repositories and resolving merge conflicts.
When you've finished with your copy, you can delete it: in Explore, its Repository Actions submenu has Delete Repository.... Or keep it, and run Set up practice again whenever you want to start over.