Part 3: Sharing
Your project folder is now a git repository with a history, but it lives on one computer. GitHub keeps a copy of that repository online, so it survives a lost laptop, you can work on it from two computers, and a colleague can read it, comment on it and help.
gh auth login. After that the agent can create repositories and push, and you approve each step.This is a hands-on unit. You put a project on GitHub and swap repositories with another participant. Publishing a web page from a repository comes next (A course or project page).
| Data class (from Privacy, ethics and safety) | On GitHub? |
|---|---|
| Public: open data, published material, your teaching material | Private or public. Public after a check of files and history |
| Internal: your unpublished results, a draft course plan | Private only, and only if your university allows GitHub for this |
| Personal data: names, grades, e-mails of students | Not in the repository. Use a synthetic stand-in, add the real files to .gitignore |
| Sensitive personal data or material given in confidence | Never |
| Exam questions before the exam | Private only; better not on GitHub at all until after the exam |
A private repository is still on someone else’s server. Your university’s rules may name an approved alternative, often an internal GitLab.
.gitignore keeps files out of the repository altogether.gitignore in the project folder lists files and folders git should never commit.data/raw/students.xlsx, *.key, .env, secrets/..gitignore before its first commit. Once it is committed, it is in the history.Ask the agent: “Add our real data files to .gitignore, then show me with git status that they are not tracked.”
gh; you run the login yourselfbrew install gh; on Windows often winget install --id GitHub.cli.gh auth login. Not inside the agent.gh auth status: it should say you are logged in to github.com.Never paste a token, password or login code into the agent’s prompt.
gh auth login asks four questions| Command the agent proposes | What it does | Risk |
|---|---|---|
gh auth status, git remote -v, gh repo view |
only looks | none |
git push |
sends your commits to GitHub | low, if the repository is private |
gh repo create NAME --private --source=. --push |
new repository from this folder | check private and the name |
gh issue create, gh issue comment |
writes an issue or comment, in your name | check the text first |
gh repo edit --visibility public --accept-visibility-change-consequences |
makes the repository public | high: everything, with history |
git push --force, gh repo delete |
overwrites history on GitHub; deletes the repository | high: say no unless you asked for it |
data/example/.”You wrote most of this in Organising a project for an agent. GitHub is where you find out whether it works for someone else.
| Not useful | Useful |
|---|---|
| “The script doesn’t work.” | “scripts/plot_growth.py stops with FileNotFoundError: it reads C:/Users/anna.k/Desktop/greenhouse/growth.csv (line 8). It should read data/raw/growth.csv.” |
| “README is confusing.” | “README says to run scripts/make_figure.py, but that file does not exist. I think it means scripts/plot_growth.py.” |
| “Add more documentation.” | “The README’s data table lists a column height_cm, but growth.csv calls it ht. Rename one of them so they match.” |
The same rule as in First delegations: point to the place, say what you expected, give the reason.
ghgh issue listgh issue createFix script name in README (fixes #1) and push.”You can do all of this on the website too. Use whichever is quicker.
LICENSE file and shows it in the About box.| When | Ask the agent | Command it uses |
|---|---|---|
| You sit down | “Pull the newest version from GitHub.” | git pull |
| You finish a step | “Commit this with a clear message.” | git add, git commit |
| You stop for the day | “Push my commits.” | git push |
/permissions).~/agentic-course/peer-review/, never into your own project.| Question for your agent | What it tests |
|---|---|
| “In three sentences: what is this project and what is its current state?” | the README and the goal |
| “Which files are raw data, which are results, which are scripts?” | the folder layout |
| “What would I run to reproduce the main figure? Do not run it.” | reproducibility |
| “Do the README, the agent instructions and the files agree?” | stale documentation |
| “Is there anything here that should not be in a shared repository?” | privacy |
| “What is the single most useful thing to fix?” | the issue you file |
Then check one answer yourself: open the file the agent points to.
.gitignore before the first commit, and stand-ins for real data.gh auth login yourself, in a second terminal. Never paste tokens into a prompt.| Concept | Key fact |
|---|---|
| GitHub | an online copy of your git repository, with the whole history |
| Push and pull | push sends commits up, pull brings them down; committed is not backed up |
| Private vs public | private for your own project; public only after checking files and history |
.gitignore |
keeps files out of the repository before their first commit |
gh auth login |
you, once, in a second terminal; the agent then pushes with your approval |
gh repo create --private |
one command: new repository from this folder, pushed |
| Concept | Key fact |
|---|---|
| README | rendered on the repository page; answers a visitor’s first questions |
| Issues | a to-do list next to the project; “fixes #1” in a commit closes issue 1 |
| Collaborators | can read and push on a personal account; invite only people you trust |
| Pull requests | propose a change for review instead of pushing it |
| Licence | CC BY for teaching material, MIT for code; none means no reuse |
Next (A course or project page): turn a repository into a public web site with Quarto and GitHub Pages, with your figures from Reproducible figures as the first content.