Your own GitHub inquiredu · for K-12 educators

Your own GitHub

Turn the page at its edges, or with the arrow keys. Your place is kept on this device.

For K-12 educators

A useful idea.
A workspace of your own.

Learn GitHub and Codespaces by making something useful for your teaching. Make a small change, try an AI assistant, check the result, and save your work. A first website is one milestone along the way. Start in your browser; chapter 1 covers what your district allows.

This page is one of the examples. To see how it's made, open its repository: inquiredu/git-guide on GitHub.

Chapter 01

Before you start

A little orientation before you make your first change.

What GitHub is

A place to keep files along with their whole history, and to show them to people if you choose. Each project lives in a repository: a folder plus every change ever saved to it. Educators use it for lesson sites, shared materials, and small tools. The history is the point: every saved change is kept, with who made it and when, so a saved change is never lost by accident. GitHub is one of several services that host Git repositories; the habits in this guide work on the others too.

A file's history: five saved changes along a line, from making the page to today index.html Make the page Add rivers Fix a typo Add a map Today Sept 3 Sept 9 Sept 10 Sept 24 Each dot is a commit: one saved change, kept forever
One file, five saved changes. Delete a line today and the version from September is still there, which is the comfort and the caution in one picture.

Why a personal account

The best way to learn this is to work on your own ideas and problems: a lesson you'd like to rebuild, a small tool you wish existed, a list you want to keep, a question you want to try out. A personal account is a place to explore, make mistakes, and start over, and the history keeps a record of what you tried.

If your district doesn't allow GitHub

Some districts limit GitHub or Codespaces on their devices, networks, or accounts, for reasons you may not see from where you sit. That's their call, and it's an answer, not an obstacle. What you're learning here is version control: keeping a history of changes, saying why you made each one, and comparing versions. Git, the free tool underneath, isn't tied to GitHub, and Google Docs and Microsoft 365 both keep version histories you can practice the same thinking on. The ideas in this guide go with you either way.

What this guide asks of you

A browser and some curiosity. Chapter 4 gets you working in Codespaces and introduces Claude Code, Codex, and Gemini CLI. Chapter 5 gives you a visible milestone: a web address of your own. The lasting skill is making, checking, saving, and returning to useful work. The end of any chapter is a fine place to stop.

Worth knowing, once

Public is public, and history is foreverWrite as if anyone could read it, because anyone can. Deleting a file doesn't remove it from the history.
Never student or staff dataNo roster, no screenshot, no “quick test file.” Use invented names, like the ones in this guide.
Never a password or API key in a fileAn API key is a password-like code that lets a program use a service. GitHub stops some keys it recognizes on their way into a public repository and scans for others afterward: a net, not a plan. If one gets in anyway, cancel the key where you got it, or change the password, before you delete the file.
Your commit email is visibleEvery saved change carries an email address, and anyone who can see the repository can see it. In Settings › Emails, one box swaps in GitHub's noreply address and another blocks pushes that would expose the real one. Chapter 2 has the step.
Forks and clones keep livingWhen your work is public, anyone can take a copy. Deleting your repository, or making it private, doesn't reach the copies. Decide what's public while the repository is still small.
Is it yours to publish?Materials you made as part of your job, a publisher's curriculum, and anything students made may not be yours alone to share or license. Ask whoever owns them (your district, the publisher, or the student and family) before they go into a repository, public or private.
Students come laterGitHub's terms require account holders to be 13 or older. Before you bring students in, talk with district officials and with families.

Starting out, honestly

You'll copy code you don't fully understand. Everyone does.

That's how reading code begins. Three habits keep it safe.

  1. 01

    Read a command before you run it, and say to yourself what it does.

    If you can't, search the command first or ask someone who can. A command you can't read is one to wait on.

  2. 02

    Treat code from an AI assistant, a forum, or this guide as a draft to read, not an answer to trust.

    An assistant can sound sure and be wrong. What it writes is yours to read before you keep it.

  3. 03

    Practice on things with no real people in them.

    Until you've seen a tool succeed and fail a few times, keep it away from anything that matters.

This guide shows one good path, not the only one. Its facts carry the date they were checked, and button names drift: if one named here isn't on your screen, look for the nearest match.

Steps

  1. 01

    Check what your district allows

    Your staff handbook, or district officials, will have the acceptable-use policy. Read what it says about devices, networks, and accounts. If GitHub isn't open to you, you can still read on for the ideas, and ask what is.

  2. 02

    Pick the email you'll sign up with

    One you control and will still have in ten years. GitHub uses it to reach you and to help you recover the account.

  3. 03

    Decide what you'll practice on

    Something with no real people in it: a lesson page about rivers, a list of your favorite poems, a made-up class called Room 12.

You're done when

You can say, in your own words, why student data, passwords, and keys never go in a repository.

Chapter 02

Your account

The free plan is enough for everything in this guide: unlimited public and private repositories, Pages from public ones, and included Codespaces hours.

Three things that open your account: a password, an authenticator app, and recovery codes for when the app is gone Your password Something you know + Authenticator app Something you have = You're in If the app is gone: 16 recovery codes
Two-factor means two of these. The recovery codes are the spare key: lose the app and the codes together, and GitHub can't let you back in.

Steps

  1. 01

    Sign up at github.com/signup

    Use the email you chose. Then verify it: until you do, you can't create a repository.

  2. 02

    Turn on two-factor authentication

    Settings › Password and authentication. GitHub suggests an authenticator app first, with a passkey or security key as backup. It asks everyone who contributes code to turn this on, so do it on day one.

  3. 03

    Save your 16 recovery codes somewhere you'll find them

    A password manager, or a printed copy at home. This is how accounts get lost: if the phone and the codes are both gone, GitHub Support can't restore the account.

Steps, continued

  1. 04

    Keep your email private

    Settings › Emails: tick Keep my email addresses private and Block command line pushes that expose my email. From then on your changes carry an address like ID+yourname@users.noreply.github.com.

  2. 05

    Optional: add your school email

    Only if you plan to apply for GitHub Education (next page), which looks for a school address. Settings › Emails › Add, then verify it. Leave the “Primary email address” dropdown as it is, so the account doesn't depend on any one job.

GitHub Education for teachers

Optional. GitHub asks that you be an educator with a verifiable school-issued email, and that you upload something proving your school affiliation, such as a faculty ID or an employment letter. You apply from your personal account: Settings › Education benefits › Start an application. People who have applied report that the form may ask your browser for your location; GitHub's own pages don't mention it. GitHub's wording is about accredited institutions and never names K-12 either way, so apply with your school email and see. Describe your role as it is; whether it qualifies is GitHub's call.

What a verified teacher gets: a free Copilot Pro subscription, a free Team plan for a shared group account (GitHub calls it an organization), GitHub Classroom, and a teacher discussion space.

Copilot, in a paragraph

Copilot is GitHub's AI assistant inside the editor. It suggests code and answers questions about the file you're in. Copilot Pro is normally $10 a month; verified teachers get it free, and GitHub re-checks eligibility every month. After your Education application is approved: profile picture › Copilot settings › Get access. Whether to use it is your call; it's one tool among several, not a requirement for anything in this guide. It's a suggestion machine, not a checker: what it writes is yours to read before you keep it. What you type into it leaves your computer, so the rule for repositories applies here too: nothing with real students or staff in it.

Free, and when you'd need Pro

WhatFreePro
Price$0A small monthly fee GitHub shows the current price on your account's billing page
RepositoriesUnlimited, public and privateThe same
GitHub PagesFrom public repositoriesFrom public and private repositories
Codespaces a month120 core hours, 15 GBchapter 4 explains core hours180 core hours, 20 GB
SupportCommunityEmail

Checked against GitHub's plans page on the date in Resources.

What a teacher might want from Pro is a public site from a private repository; chapter 5 explains why that matters less than it sounds.

You're done when

You can sign in with your authenticator app, and you know exactly where your recovery codes are.

Chapter 03

Words you'll meet

Eleven words that come up in the rest of this guide, in plain language. One picture holds most of them.

How the words fit together: a clone where you work, commits pushed to your repository on GitHub, a branch inside it, a fork on someone else's account, and a pull request coming back Where you work a codespace, which holds a clone of your repository push Your repository on GitHub main branch each dot is a commit · a README says what it's for fork: a copy Someone else's fork, on their account pull request: a proposed change
Work happens in a clone, commits travel up by push, a branch is a side track inside the repository, a fork is someone's own copy, and a pull request is how a change is offered back.
Repository
A project's folder, with every file's history kept alongside. “Repo” for short.
Commit
One saved change, with a short note about what you did and why. Each gets a permanent ID.
Push
Sending your commits from where you made them up to GitHub. In a codespace this is the Sync Changes button.
Branch
A parallel version of the repository where you can try something without touching the main one. The main one is usually called main.
Fork
Your own copy of someone else's repository, on your account. You can change it freely; the original doesn't change. Forking a public repository is allowed on GitHub; reusing its contents elsewhere depends on its license (chapter 6).
Clone
A copy of a repository on a computer, or the act of making one. A codespace clones your repository to get started.
Pull request
A proposed change, shown as a comparison, that someone can review and accept. How people suggest fixes to each other's work.
README
A text file that says what the repository is. GitHub shows it on the repository's front page.
.gitignore
A list of files Git should leave out of commits. Where you name anything that must never be pushed.
Markdown
Plain text with light formatting marks: # for a heading, * for a list. READMEs are written in it.
Issue
A note attached to a repository: a task, a question, a bug. Anyone with a GitHub account can open one on a public repository that has issues turned on.

You'll learn these by doing. Don't stop for them.

Merge, remote, origin, HEAD, staging, rebase, Actions, workflow, token, SSH. Each will make sense the first time it's in front of you, and not before. If one blocks you, search “github docs” plus the word.

Steps

  1. 01

    Read the eleven once

    Then come back when a word stops you. That's what this chapter is for.

You're done when

You can explain the difference between a commit and a push to a colleague.

Chapter 04

Codespaces

A computer on GitHub's servers that you use through a browser tab. On a Chromebook or any computer with a browser, the tab is all you need, and nothing needs installing.

A codespace opens with a copy of one repository and a web version of Visual Studio Code, a widely used editor, already set up. You edit, save, commit, and push from inside the tab. Close the tab and the codespace waits for you; open it again and your files are where you left them.

Your computer shows a browser tab; the codespace itself runs on GitHub's servers with an editor, a copy of your repository, and a key to that repository; pushes go to your repository on GitHub Your computer a browser tab that's all GitHub's servers your codespace the editor a copy of your repository a key to that repository what you type happens here push yourrepository
The tab is a window. The computer, the files, and the key are on GitHub's side of the glass.

What you get

WhatFreePro
Core hours a month120GitHub counts hours times the size of the machine. The default machine counts double, so 120 core hours is about 60 hours of use.180
Storage15 GB20 GB
Stops when idleAfter 30 minutes. Your work is still there when you come back.
Deleted if unusedAfter 30 days, including anything not pushed. Commit and push before you close the lid for the month.
At the limitUse stops. With no payment method on file, nothing is charged.

Checked against GitHub's billing and Codespaces docs on the dates in Resources.

The honest safety picture

A codespace protects your device, not your account or your data.

  1. 01

    A codespace carries a key to the repository it opened.

    If you can write to that repository, so can anything running inside the codespace. If you can only read it, the key only lets it be copied.

  2. 02

    Opening a stranger's repository runs their setup commands.

    A repository can carry a setup file (devcontainer.json) that installs extensions and runs any command when the codespace is created. Open only your own repositories, or ones from people you know and trust. GitHub gives the same advice.

  3. 03

    What you type or sign in to happens on GitHub's servers, not your computer.

    Don't sign in to school systems inside a codespace, and don't paste anything there you wouldn't put in the repository.

  4. 04

    Previewing a page opens a door.

    When you preview a site from a codespace, GitHub offers a temporary address. Leave it Private, which means only you. Public means anyone on the internet.

Steps

  1. 01

    Make a repository to practice in

    github.com › the plus sign › New repository. Name it room-12, tick “Add a README file,” and make it public: chapter 5 needs that on the free plan, and this practice repository holds nothing that matters. That README is your first file.

  2. 02

    Open a codespace on it

    Code›Codespaces›Create codespace on main

    A line at the bottom of that dialog says who pays. For your own repository on the free plan, it's your included hours. Wait a minute while it builds.

  3. 03

    Find the editor, the terminal, and Source Control

    The editor is the big middle. The file list is on the left, and the icon under it with the branching lines is Source Control. The terminal, a text box that takes typed commands, is along the bottom; if it's hidden, the three-line menu icon at the top left has Terminal › New Terminal. You'll mostly use the editor.

Steps, continued

  1. 04

    Change a file, commit, and push

    Open README.md, add a line, save. In Source Control, type a short message in the box (“Add a welcome line”), click Commit, then Sync Changes. Read the changed-file list before staging: include only files you meant to change. If Sync asks to pull and push, say OK. Back on github.com, reload the repository: your line is there, and the commit carries your noreply address.

  2. 05

    Stop the codespace when you're done for the day

    github.com/codespaces lists yours. The three-dot menu beside it has Stop codespace, and Delete when you no longer want it. Stopping saves your hours; it would stop itself after 30 idle minutes anyway.

You're done when

You've changed a file inside a codespace and seen the change appear on github.com.

AI help, when you want it

Describe a change. See it in your files. Decide what stays.

An assistant connected to your codespace can explain a file, suggest a revision, and make an edit for you to inspect. For a teacher, that might mean clearer activity instructions, three discussion questions, or a small classroom tool.

Keep making progress

You do not need an AI account to finish this guide. Make your first lesson-file change → If you already have an approved assistant, you can use it for the same exercise.

These are three options, not three things to install. Choose a service you already use and are allowed to connect. GitHub sign-in does not include access to these services.

Claude CodeDiscuss and revise a file beside your editorExplore

Claude Code's editor panel can read your project, explain its contents, and propose edits for you to review. Try asking it to make one activity's instructions easier to follow.

In Extensions, the official listing is Claude Code for VS Code, published by Anthropic. It needs an eligible Claude subscription or Console account. Its terminal version is a separate installation.

Official editor setup · Terminal setup and account access · Reusable container setup. Checked in Resources.

CodexAsk for a change and review what it didExplore

Codex can read and edit project files and run checks. Try a small request such as adding three questions to a lesson while preserving your original wording.

It is available as a terminal tool and an editor extension. A terminal tool is a conversation you start by typing a command in the codespace. Remote sign-in may require device-code access to be enabled by you or your administrator.

Official terminal setup · Editor option · Account and sign-in help. Checked in Resources.

Gemini CLIWork on your project through a terminal conversationExplore

Gemini CLI can explain and change files in your project. Try asking it to organize an invented set of lesson notes, then inspect the changes in the editor.

CLI means command-line interface: you start the conversation in the codespace's terminal. Gemini CLI is separate from the Gemini Code Assist editor panel. School and Workspace accounts may need administrator involvement and a Google Cloud project.

Official installation guide · Account and sign-in options. Checked in Resources.

What we actually tested

In a fresh blank Codespace, all three installed and opened. Claude Code completed sign-in after a manual browser handoff. Codex reached device-code sign-in but required an account security setting; Gemini reached its Google authorization prompt. We did not complete a lesson-editing test with any of them.

Repeated sign-in handoffs interrupted the walkthrough. These are capabilities to explore, not a promise of a seamless setup. If login loops, a localhost page fails, or account settings get in the way, leave setup for later and continue the lesson exercise. The providers' linked instructions are the place to resume.

Use invented practice material. Connected assistants may send prompts and project content to their providers. Keep approval prompts on and review changes. If an approved setup needs an API key, use a Codespaces secret; keep it out of files and chat.

Make one useful change

A lesson note you can improve, save, and return to.

Use your practice repository with invented material. You can do every step yourself in the editor. If an assistant is already connected, the optional prompts below let you try the same change with help.

  1. 01

    Make a starting point you can return to

    Create lesson.md in the file list. Type a heading, # River questions, and a sentence: “How does a river change the land?” Save, commit, and sync as in the previous steps. The .md ending means a plain-text document with simple formatting.

  2. 02

    Add something useful

    Keep your original question. Add these three questions underneath, or write three of your own. Save the file, then review the difference before committing.

A change to try

  • Where might a river wear away its bank?
  • What happens to the soil and stones the water carries?
  • What evidence would show that a river's path has changed?
Already connected? Try this with your assistant

Put these prompts in the assistant's conversation panel or its signed-in terminal conversation, not in an ordinary terminal command prompt. Start before adding the questions yourself.

Look first

I am a teacher learning this workspace. Read lesson.md and explain what is in it in plain language. Do not change anything yet. Suggest three discussion questions about how rivers change the land, and tell me where you would put them. Use no student information.

Check its explanation against the file. If its suggestion is useful, follow up:

Then make one change

Add those questions to lesson.md only. Keep my original question. Explain each change. Do not install anything, commit, push, or publish.

Open the file to see what actually changed. Keep approval prompts on; choose Manual mode if the assistant offers it. You decide whether the questions fit your teaching.

You've got it when

You can point to a changed line and explain why it is there. Next, inspect the difference and practice keeping or undoing a change.

Keep it, change it, or undo it

Open Source Control and select lesson.md. Read the difference between the saved version and the new one. Check that your original question remains, there are three new questions, and no unrelated file changed. You still decide whether the questions make sense for your teaching.

If the result helps, commit it with a message such as “Add river discussion questions,” then sync. If it misses the point, describe one correction. You do not need to accept every suggestion.

Practice undoing an unwanted change

After committing a version of lesson.md that you want to keep, add a temporary line and save without committing. In a new terminal, run:

git diff -- lesson.md

This shows the unsaved-to-Git difference. Copy any wording you want to keep elsewhere before the next command:

git restore --source=HEAD -- lesson.md

This discards uncommitted changes in that file only and restores its last committed version. Open the file and confirm the temporary line is gone. Do not use it on work you still want.

A workspace you can come back to

Leave a sentence in your README about what you want to try next, commit and sync it, then stop the codespace. Next time, reopen it and read that note before starting an assistant. Your project's files and history are the continuity; the chat is help along the way.

A lesson collectionKeep activities as readable files. Ask an assistant to improve one set of instructions; review the teaching yourself.
A small classroom toolTry a timer or a random discussion-prompt picker using invented content. Test its behavior, including what happens when you press a button twice.
A repeatable taskPractice reformatting made-up text files. Later, chapter 7 introduces an Apps Script connection for work you own.

Next: make something visible

Chapter 5 turns a small page into a website. It's a useful first milestone: you can see and share a result. The larger skill is knowing how to make, check, save, and revisit your work.

Chapter 05

GitHub Pages

A free web address for the files in a repository. Put a web page file named index.html in, turn Pages on, and a few minutes later anyone can open it.

From a repository holding index.html, through Pages, to a public web address anyone can open; a private repository's site is public all the same Your repository holds index.html Pages Settings › Pages yourname.github.io/room-12 anyone on the internet Private repository the site is still public
Private hides the files and the history. The address Pages makes from them is on the open internet either way.

What it needs

  • A public repository, on the free plan. (Pro can publish from a private one.)
  • An entry file at the top: index.html, index.md, or README.md.
  • Pages turned on: Settings › Pages › Deploy from a branch.

Two kinds of address. A repository named yourname.github.io becomes https://yourname.github.io. Any other repository becomes https://yourname.github.io/its-name. Start with the second kind.

Worth knowing, once

A Pages site is public, even from a private repositoryPrivate hides the files, not the site. That's why Pro's “Pages from private repositories” rarely matters for a teacher: what people see is public either way.
Visitors are loggedGitHub keeps visitors' IP addresses for security, students' included if you send them there.
No logins or paymentsNothing on a Pages site should ask for a password or a card number; GitHub says not to.
It's for small sitesUp to 1 GB. If a site passes 100 GB of traffic a month or is rebuilt more than 10 times an hour, GitHub may get in touch; a lesson site won't come near either. It isn't for running a business.

Steps

  1. 01

    Add an index.html to your practice repository

    In the codespace, or with Add file › Create new file on github.com. Name it index.html and paste this in, then change the words. This is HTML, the plain text a web page is made of; the words between the angle-bracket tags are yours. (A fuller version with notes is in the Library.)

    <!doctype html>
    <html lang="en">
    <head><meta charset="utf-8"><title>Room 12</title></head>
    <body>
      <h1>Room 12 reads about rivers</h1>
      <p>This week: where the Mississippi starts.</p>
    </body>
    </html>
  2. 02

    Commit and push it

    Source Control › message › Commit › Sync Changes, as in chapter 4. Or, on github.com, Commit changes.

Steps, continued

  1. 03

    Turn Pages on

    Settings›Pages›Deploy from a branch›main›Save

  2. 04

    Wait, then open the address

    Up to 10 minutes the first time, usually less. The address appears on the same Settings › Pages screen. Open it on a phone, too: if it loads there, it's on the open internet.

You're done when

Your address loads on a phone. From here on, every push updates the site, usually within a few minutes; GitHub says up to 10.

Chapter 06

Public, private, and licenses

Visibility says who can see your work. A license says what they may do with it. They're separate switches, and the second is the easy one to forget.

Two switches: visibility, public or private, says who can see; license, none or MIT or CC BY, says what they may do Switch one · visibility · who can see Public Private Anyone, or only people you invite. Switch two · license · what they may do None MIT CC BY “None” means all rights reserved: they can look and fork, and that's all.
A public repository with no license is the default, and it's the one most people don't mean: visible to everyone, usable by no one.
PublicAnyone on the internet can read the files and the whole history, and can fork a copy. GitHub's terms say that making a repository public is agreeing to that. Search engines can find it.
PrivateOnly you and the people you invite. GitHub itself still holds the files, so private is still no place for student data. On Pro, a Pages site built from a private repository is still public.
Public to privateForks that already exist stay public on their own, and a published Pages site is taken down.
Private to publicEverything becomes visible at once, including every old commit. Read the history first as if you were a stranger.

No license means all rights reserved

With no license file, default copyright applies: you keep every right, and nobody may legally copy, share, or build on your work, even though GitHub's terms let them look and fork. If you want colleagues to be able to use a lesson, that's the opposite of what you mean, and a license fixes it in a minute. Keeping all rights is a fair choice too; the point is that it should be a choice.

MIT, for codeShort and permissive. Anyone may use, change, and share it, as long as they keep your copyright line and the license text. The usual choice for a small tool or a site.
CC BY 4.0, for lesson materialCreative Commons Attribution. Anyone may share and adapt it, even commercially, as long as they credit you, link the license, and say what they changed.
CC BY-SA 4.0, for material that should stay openThe same, plus ShareAlike: anything built on it has to carry the same license.

Both Creative Commons licenses are in GitHub's own license picker, so adding one takes the same minute as MIT. A repository with code and lesson text can carry two licenses: MIT in LICENSE, and a line in the README saying the words are CC BY 4.0. The Library has that notice ready to paste. This guide does the same with CC BY-NC 4.0 for its words (no commercial use); that license isn't in GitHub's picker, so the README and the footer of every page name it.

A license only covers what's yours to license, which may not include work made for your job, a publisher's materials, or student work. If you aren't sure, ask first.

Steps

  1. 01

    Decide what's public while the repository is still small

    Settings › General › Danger Zone › Change visibility. You can change it later, but the whole history changes with it.

  2. 02

    Add a license

    Add file›Create new file›LICENSE›Choose a license template

    Pick one, fill in the year and your name, Review and submit, Commit changes. The repository's front page now shows the license beside the description.

You're done when

A colleague could open your repository and know, without asking you, whether they may use it in their classroom.

Chapter 07

Pro tip: clasp for Apps Script

If you already write Apps Script for Sheets or Forms, this chapter is for you. If not, or if your district uses Microsoft 365, skip it; the idea of a readable history still applies, and the chapter will be here.

Cautions first

It touches a Google account, so read these before the steps.

  1. 01

    It needs the Apps Script API turned on for the Google account.

    The switch is at script.google.com/home/usersettings. A district's Workspace administrator can also turn Apps Script off for its accounts; if yours has, that's the district's answer for those accounts.

  2. 02

    Its login stores a Google token where it runs.

    After clasp login, a file called .clasprc.json in the home folder holds a saved sign-in (a token) for your Apps Script projects. In a codespace, that home folder is on GitHub's server. Log out when you're done.

  3. 03

    Practice on scripts that are yours, in a Google account that's yours.

    A district account's login token would sit on GitHub's server, outside the district's control. A script that belongs to your district, or touches its sheets, forms, or people's information, isn't yours to copy out. Before you use either, ask district officials. They may say yes; the asking is the point.

What clasp gives you

Apps Script's browser editor keeps versions, but not a Git history you can share or keep somewhere of your own. clasp is Google's tool for the terminal you met in chapter 4: it copies a script project to ordinary files and back. Put those files in a repository and you get everything this guide has been about: a history of every change, a place to describe the project, pull requests from a colleague, and a codespace to edit it in from any browser.

clasp copies a script project from the Apps Script editor to files in your repository and back; its saved sign-in lives on the computer running clasp Apps Script editor script.google.com versions, but no Git history clasp pull · push Files in your repository history, a README, pull requests .clasprc.json: a saved sign-in on whatever computer runs clasp; in a codespace, that's GitHub's server
clasp is a courier between the two. The courier keeps a key, and the key lives wherever the courier does.

Steps

  1. 01

    Turn on the Apps Script API for the Google account you're practicing with

    Open script.google.com/home/usersettings, signed in as that account, and switch it on.

  2. 02

    Install clasp in a codespace

    In the terminal of a codespace on your own repository. The default codespace already has Node, the program clasp runs on; npm is Node's installer, and -g means for the whole codespace.

    npm install -g @google/clasp

    Or let the codespace install it as it builds: the Library guide explains every line before you copy it.

  3. 03

    Log in without a local browser

    A codespace can't open a window on your screen, so --no-localhost prints a link instead. Open it, sign in as that same account, and paste the code back into the terminal.

    clasp login --no-localhost

Steps, continued

  1. 04

    Bring a script project down, change it, push it back

    The script ID is in the project's settings in the Apps Script editor. Replace <script-id>, brackets included, with it; --rootDir src gives the script's files their own folder. Before you commit, read every file once: scripts often carry a spreadsheet ID or an email address, and a public repository shows them to everyone. Check, too, that your .gitignore names .clasprc.json; the Library guide has one, explained line by line. And clasp push replaces the whole online copy with yours, so pull before you push if anyone else edits the project.

    clasp clone-script <script-id> --rootDir src
    clasp pull
    clasp push
  2. 05

    Log out before you leave

    This deletes the saved sign-in from the codespace. Do it every time you finish.

    clasp logout

You're done when

A script of yours lives in a repository with a history, and you've logged clasp out.

Chapter 08

Resources

Every page this guide leans on, grouped by chapter, with the day it was opened. Prices, hours, and limits change; the date tells you how old each claim is.

Each entry says who publishes the page and what it says, in our words. If a figure on a page has moved since the date shown, the page is right and this guide is behind. If you find one, tell us on GitHub; it takes a GitHub account, and the report is public.