Ship TaskKit: publish it on GitHub with a README and a short demo recording
Make a GitHub account, sign in with the GitHub CLI, publish TaskKit's first commit on GitHub, let a friend clone it, and add a short screen recording to its README. See how a change travels with push and pull.
Fundamentals
TypeScript
Ship TaskKit: publish it on GitHub with a README and a short demo recording. Read this lesson at .
Tested with TypeScript 7.x · Node.js LTS
A friend sees TaskKit warn you about Christmas Day and asks whether
she can try it. TaskKit has its first commit now, but a commit is
saved on your computer only, where she cannot reach it. You could zip
the taskkit folder, pack it into one compressed file, and send it.
The zip would carry node_modules and tasks.json, the two things
your .gitignore keeps out: nearly 50 MB (megabytes) of packages, and
your own list. And next week, when you fix something, she would need a
new zip.
Programmers share a project with a link instead. By the end of this
lesson, TaskKit lives on GitHub at an address of its own, its README
is the first thing a visitor reads, a 20-second recording in the
README shows it at work, your friend can get it with git clone, and
every later change reaches her when you run three commands and she
runs one.
GitHub keeps a copy
GitHub, the website from lesson 15.1, keeps a copy of your
repository, and sending your commits to that copy is called
pushing. A commit is the snapshot of lesson 15.2; this lesson uses
both words. Git does the pushing. One more program, the GitHub CLI
you installed in lesson 15.2, gh for short, signs you in to GitHub
and makes the copy there. CLI stands for command-line interface: a
program you use by typing commands, as you use TaskKit.
People often take Git and GitHub for one thing. They are two:
Git
Keeps snapshots of your folder
On your computer. You type git in the terminal, and nothing
leaves your computer until you push.
GitHub
Keeps a copy, shows the README
A website, github.com, open to anyone with the link. It has only
what you send it.
Git keeps your snapshots; GitHub keeps a copy of them
Make a GitHub account
Git and gh are installed, and now you need an account. If you made
it in lesson 15.2, to keep your email address private, you already
have one. If not, it is free: go to github.com,
press Sign up, and follow the steps. GitHub asks you to confirm
your email address; do it, because GitHub does not let you create a
repository until you have. The username you choose becomes part of
TaskKit's address: in this lesson it is ana, so wherever you see
ana in an address, read your own username.
Put TaskKit on GitHub
TaskKit has its first commit, but gh is not signed in to your account
yet. Sign it in once:
It asks four questions. Move with the arrow keys and press
Enter (return on a Mac) to choose. To
authenticate is to prove that it is you. Each question, and the
answer to give:
Where do you use GitHub?GitHub.com
How would you like to authenticate GitHub CLI?Login with a web browser
What is your preferred protocol for Git operations on this host?HTTPS (HTTP Secure; HTTP, Hypertext Transfer Protocol, is lesson
12.4's set of rules for talking to websites), the same safe way your
browser talks to websites, so nothing else needs setting up
Authenticate Git with your GitHub credentials?Yes, by pressing
Enter
After the first answer, gh prints a line starting ! Did you know that expiring tokens can be requested with --expiring?. It is a tip,
not an error: carry on with the next question.
The last answer matters: it lets git itself push to GitHub later,
using the sign-in gh keeps for you, so you never type a password in
the terminal. Then gh shows a one-time code of eight characters,
already copied to the clipboard, the place copied text waits until you
paste it:
On Linux the second line is one long line in your terminal, broken
here to fit, and the red message about the clipboard is harmless: copy
the code from the terminal instead. Press Enter, paste the
code into the page that opens, and confirm that GitHub CLI may use
your account. Back in the terminal, gh finishes:
Now make the repository on GitHub and push your snapshot to it, all in
one command:
taskkit is the repository's name on GitHub. --public lets anyone
see it, which is the point of sharing it. --source=. says the
snapshots come from this folder, and --push sends them right away.
A remote is Git's name for a copy of the repository somewhere
else; gh added GitHub's copy and called it origin. The line
branch 'main' set up to track 'origin/main' says that your main
now follows GitHub's, so from here on a plain git push knows where to
send. The numbers in the middle count what was packed and sent, in KiB
(kibibytes, about a thousand bytes) and MiB (mebibytes, about a
million), and yours will differ.
Open the page:
The browser shows your files, without node_modules and tasks.json,
and under them the README from lesson 15.1, as the project's front
page. That address is the link you send your friend.
How your friend gets TaskKit
Your friend needs Git and Node.js too. To get her own copy of the
repository, every snapshot included, she clones it: in her
projects folder, she types
git clone makes a taskkit folder with every file you pushed, cd
goes into it, and npm ci rebuilds node_modules. Next week, when you
push a fix, she runs git pull in that folder and has it. Someone
without Git can press the green Code button on the repository's
page and choose Download ZIP, but a ZIP is a copy of today only.
The README still starts at npm ci, as if the reader already had the
folder. Change its Install section in VS Code (Visual Studio Code,
your editor):
Save it, and ask Git what changed:
modified is the word from lesson 15.2: Git has the file in a
snapshot, and it has changed since. Every change you want on GitHub
takes the same three commands: pick it, commit it, push it.
The push ends with the two commits it moves between:
Reload the page in your browser, and the README's Install section
starts with git clone.
Record a short demo
A README says what TaskKit does; a recording shows it in twenty
seconds. The video is public too, so record in a fresh copy, cloned
the way your friend would: its list starts empty, and you see your own
README work for a stranger. From your taskkit folder:
The word after the address names the new folder, so it does not clash
with your own taskkit. In the recording, type:
The first command shows the holiday warning in yellow, and the second
lists TaskKit's commands. Keep the recording short, so the file stays
under GitHub's limit of 10 MB for a video.
1
Record the terminal
Type clear and press Enter to empty the terminal, then
record only the part of the screen where the terminal is.
Press ⇧ Shift + ⌘ Cmd + 5, choose
Record Selected Portion in the bar that appears, drag the frame
around the terminal, and press Record. Type the two commands. To
stop, press the stop button in the menu bar at the top of the screen.
The recording lands on your desktop as Screen Recording with the date
and time, a .mov file.
Press Windows + Shift + R to open the
Snipping Tool's recorder, drag a frame around the terminal, and press
Start. Type the two commands, then press Stop, and save the
recording from the window that opens.
Press Print, switch the bar at the bottom from screenshot to
screencast with the camera icon, choose Selection, drag a frame
around the terminal, and press the round red button. Type the two
commands. To stop, press the red indicator at the top right of the
screen. The recording lands in Videos/Screencasts in your home
folder.
If the file is over 10 MB, record again, shorter or with a smaller
frame. Then go back to your own folder with cd ../taskkit; the
taskkit-demo folder can be deleted.
2
Add it to the README on GitHub
On your repository's page, press README.md in the list of files,
then the pencil button, Edit file. GitHub opens the README in an
editor in the browser. Put the cursor on the empty line under the
first paragraph, and drag your recording into the editor. GitHub
uploads it and writes its address on that line, one that starts with
https://github.com/user-attachments/assets/. An address like that,
on a line of its own, plays as a video on the README's page.
Press Commit changes…, keep the message GitHub suggests or write
your own, leave Commit directly to the main branch selected, and
press Commit changes again in the box that opens.
You just made a commit, but on GitHub, not on your computer. For the
first time, GitHub's copy has a snapshot yours does not. Press Next
step to follow the snapshots between the two copies:
Yourcomputer
GitHub
1
Your computer, to itself: gitcommit
2
Your computer to GitHub: gitpush
All 4 steps shown.Step 1 of 4: Your computer — git commitStep 2 of 4: Your computer → GitHub — git pushStep 3 of 4: GitHub — Commit changesStep 4 of 4: GitHub → Your computer — git pull
All 4 steps shown.
Pulling is the other direction: git pull brings GitHub's new
snapshots down and updates your files with them, as it does for your
friend.
Predict before you run
The video is in GitHub's README and not yet in yours. Before you
pull, you ask Git what it sees:
Predict
What does the second line of git status say?
Now bring the change down:
Fast-forward means Git only had to add GitHub's new snapshot on top
of yours; the numbers before it will differ for you. Open README.md
in VS Code: the video's address is there. Pull like this after every
change made on GitHub, so your next commit starts from GitHub's
newest snapshot.
The common mistake: a push with no commit
A push sends commits, not files, so a change that is saved in VS Code
but never committed stays on your computer.
Common mistake
Pushing a change that was never committed
TaskKit is published, so you raise its version: in index.ts,
const version = "0.1"; becomes const version = "1.0";. You save
the file and send it:
Git answers that everything is up to date, which sounds like success,
and index.ts on GitHub still says "0.1". Git is right: every
commit on your computer is already on GitHub. The new version is in
no commit yet.
Everything up-to-date
The fix
Commit it first, then push:
When GitHub does not show a change you made, run git status first.
A modified: line under Changes not staged for commit means the
change was never added or committed, and Your branch is ahead of 'origin/main' means it was committed but not pushed.
Another copy of the repository; GitHub's is origin
Push, pull
Send your commits to GitHub; bring GitHub's down
Clone
Make your own copy of a repository from GitHub
Git
Write
To
git push
Send your new commits to GitHub
git pull
Bring GitHub's new commits to your computer
git clone https://github.com/ana/taskkit
Get a copy of TaskKit
GitHub CLI
Write
To
gh auth login
Sign in to GitHub, once
gh repo create taskkit --public--source=.--push
Publish the folder
gh repo view --web
Open the repository's page
Rules
Rule
What it means
Add, commit, push
Every change, in that order
A push sends commits
An uncommitted change stays on your computer
A change made on GitHub
git pull brings it to your computer
Where to go next
TaskKit is published: one link shows its files, its README and a
recording of it at work, anyone can get it with git clone, and you
send every later change with git add, git commit and git push.
Next is Self-assessment: are you ready for Level 2?, the last
lesson of Level 1, where you check what you can do now against what
Level 2 expects.
Before you move on, send the link to your friend and ask her to follow
the README from its first line on her own computer. If a step fails for
her, the README is missing it: fix it, then add, commit and push the
fix, and ask her to git pull.
3
GitHub, to itself: Commitchanges
4
GitHub to Your computer: gitpull
push sends your snapshots to GitHub, pull brings its new ones back
Exercise · Read the code
Where is the commit?
You changed index.ts, ran git add index.ts, and committed it with
git commit -m "Use my country". Now git status prints this. What
does it tell you?
Outputtext
✓ Authentication complete.- gh config set -h github.com git_protocol https✓ Configured git protocol✓ Logged in as ana
Outputtext
✓ Created repository ana/taskkit on github.com https://github.com/ana/taskkit✓ Added remote https://github.com/ana/taskkit.gitEnumerating objects: 26, done.Counting objects: 100% (26/26), done.Delta compression using up to 12 threadsCompressing objects: 100% (25/25), done.Writing objects: 100% (26/26), 12.80 KiB | 12.80 MiB/s, done.Total 26 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)remote: Resolving deltas: 100% (1/1), done.To https://github.com/ana/taskkit.git * [new branch] HEAD -> mainbranch 'main' set up to track 'origin/main'.✓ Pushed commits to https://github.com/ana/taskkit.git
Outputtext
Opening https://github.com/ana/taskkit in your browser.
On branch mainYour branch is up to date with 'origin/main'.Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: README.mdno changes added to commit (use "git add" and/or "git commit -a")
The last two lines of git pushtext
To https://github.com/ana/taskkit.git 25a9647..d887687 main -> main
! One-time code (A1B2-C3D4) copied to clipboardPress Enter to open https://github.com/login/device in your browser...
! One-time code (A1B2-C3D4) copied to clipboardPress Enter to open https://github.com/login/device in your browser...
! Failed to copy one-time code to clipboard No clipboard utilities available. Please install xsel, xclip,wl-clipboard or Termux:API add-on for termux-clipboard-get/set.! First copy your one-time code: A1B2-C3D4Press Enter to open https://github.com/login/device in your browser...
Exercise · Fix the error
Publish, then share, in order
This program prints the commands that publish TaskKit and let your
friend get it, but in an order that would fail. Change the order of
the lines, without changing any line itself. Your taskkit folder
already has its first commit.
Loading the editor…
Exercise · Write the code
Send a README change to GitHub
You added a ## Public holidays section to README.md. Print, one
per line, the three commands that send it to GitHub: pick
README.md, commit it with the message Add holidays section, and
push.
Loading the editor…
README.mdmd
## InstallYou need Git and Node.js 24 or newer. Get TaskKit and its packages:```bashgit clone https://github.com/ana/taskkitcd taskkitnpm ci```
text
On branch mainYour branch is ahead of 'origin/main' by 1 commit. (use "git push" to publish your local commits)nothing to commit, working tree clean