GitHub as the Shared Record
Remotes, push and pull, and why origin/main is the product.
Learning objectives
- Separate Git on the laptop from GitHub as the shared remote
- Explain why the remote, not the agent’s memory, is the source of truth
- Set the rule that production follows
mainon GitHub
Two copies, one authority
Git on the laptop is enough to undo an edit you made five minutes ago. It is not enough when a second computer, a hosting server, or a second agent also touches the app. GitHub holds a copy of the same commit chain, called a remote. The usual remote name is origin.
git push sends commits from the laptop to GitHub. git pull brings commits from GitHub back down. After a push, the history exists even if the laptop dies. That is the first reason GitHub matters. The second is social: GitHub is where a pull request, a review comment, and a protected main branch live. The agent can be fast. The remote is where “allowed” is decided.
# One-time, after the GitHub repository exists and is empty
cd studio
git init
git add .
git commit -m "Initial booking app, generated and reviewed"
git branch -M main
git remote add origin git@github.com:workshopco/studio.git
git push -u origin main
Use the SSH URL once Book 6’s key habit is in place, or GitHub’s HTTPS URL with a personal access token if you are not ready for keys. Do not put the token in the repository.
What “source of truth” means
For Workshop Co., the rule is simple and strict:
- The booking site in production is whatever commit
mainpoints at on GitHub. - An agent’s working tree is a proposal until those commits are on
origin/main. - If the laptop and GitHub disagree, GitHub wins for anything a customer can see. The laptop wins only for uncommitted experiments that have not been pushed.
This is why agentic work has to go through GitHub and not through “the agent deployed from its own folder.” Two agents, or the same agent in two chats, will otherwise invent two versions of reserve.php. The remote makes them share one chain. You can see who raced ahead.
| Place | Trust it for | Do not trust it for |
|---|---|---|
| Agent chat | What you asked, and what the model claimed | The bytes on disk, or what production is running |
| Working tree | The experiment in front of you | History, authorship, or a rollback |
| Local commits not pushed | Undo on this machine | Anyone else, including the host that deploys the site |
origin/main | The audited product | Nothing, if you skipped review and pushed secrets |
Keep the booking app in one GitHub repository. Do not let the agent create studio-final, studio-v2, and studio-fixed as separate folders with no shared history. Branches exist so you do not need a new folder for every idea.
Where is the product?
The agent says the waitlist works on the laptop. git status shows modified files. git log origin/main does not mention a waitlist. Is the waitlist part of the product?
Answer
No. It is an uncommitted edit in one working tree. Customers, the server, and tomorrow’s agent do not have it. It becomes part of the product only after a commit is reviewed and pushed to main.