Guides · Repos

Repositories for beginners, and how to let an agent work in one safely

A repository is a project folder that remembers its whole history. Learn the five words you need, the everyday loop, and eight rules that keep an AI agent from breaking your project.

Updated Official docs checked Nov 15, 2026. Every tip links to its source.

What a repository is

A repository, or repo, is a project folder that keeps its whole history. Git is the tool that tracks that history on your computer. GitHub is a website that keeps a copy online, so you can share it and review changes with others.

Source GitHub Docs: What is GitHub reference

The five words you need

  1. Clone

    Download a copy of a repo to your computer.

    Clone command
    git clone https://github.com/OWNER/REPO.git
    cd REPO

    Source Git docs: git clone reference

  2. Branch

    A parallel copy where you can try things without touching the main version.

    Branch command
    git switch -c fix-login-bug

    Source Git docs: git switch reference

  3. Commit

    A saved checkpoint with a short message about what changed. Check what you are saving first.

    Commit command
    git status
    git diff
    git add -A
    git commit -m "Fix login redirect loop"

    Sources Git docs: git commit referenceGit docs: git diff reference

  4. Push

    Upload your branch to GitHub.

    Push command
    git push -u origin fix-login-bug

    Source Git docs: git push reference

  5. Pull request (PR)

    A request to merge your branch into main. You, or others, review the changes line by line before they go in. Open one on the GitHub website or from the terminal.

    Pull request (PR) command
    gh pr create

    Sources GitHub Docs: Pull requests referenceGitHub CLI manual: gh pr create reference

The everyday loop

Get the latest main, make a branch, change things, commit, push, open a pull request, review it, merge it.

Everyday loop
git switch main
git pull
git switch -c my-change
# make your changes, then:
git add -A
git commit -m "Describe the change"
git push -u origin my-change
gh pr create

Eight rules for letting an agent work in a repo

One line to remember: branch first, commit often, read every diff, keep secrets out, and make the agent prove it works.

  1. Give it a branch, never main.

    If the work is bad, delete the branch and nothing is lost.

    Source Git docs: git switch reference

  2. Commit before you start.

    That gives you a clean checkpoint. git restore . throws away uncommitted changes, so commit first.

    Source Git docs: git restore reference

  3. Read every diff.

    Use git diff or the pull request view. If you don’t understand a change, ask the agent to explain it before you keep it.

    Sources Git docs: git diff referenceGitHub Docs: Pull requests reference

  4. Keep secrets out.

    Put keys in a .env file, add .env to .gitignore, and never paste keys into the chat.

    Sources Git docs: gitignore referenceGitHub Docs: Ignoring files reference

  5. Limit what it can do.

    Keep approvals on for anything that deletes files, installs packages, pushes code or touches production. Anthropic suggests asking before actions “that are hard to reverse, affect shared systems, or could be destructive.”

    Source Anthropic: Prompting best practices undated

  6. Make tests the judge.

    Ask the agent to run the tests and show the output. No tests yet? Make “add a test for this” part of the first task.

    Source Claude Code: Best practices undated

  7. Merge through a pull request.

    Protect main on GitHub so nothing lands without a PR. Even on your own, the PR screen is the best place to read the whole change.

    Source GitHub Docs: About protected branches reference

  8. No force-push unless you know why.

    git push --force can overwrite commits other people already pushed.

    Source Git docs: git push reference

Five beginner mistakes with coding agents

  • A vague request with no definition of done. Use the prompt template: goal, context, constraints, done when.
  • Not reading the diff. Changes you didn’t review are how bugs, deleted code and leaked keys get in.
  • Working on main with no commits. If the agent breaks something, there is nothing to go back to.
  • Giving it secrets. Pasting API keys into chat, or letting the agent write them into files.
  • Trusting “done” without proof. Ask for the command and its output, or run it yourself.

From our own coding sessions, not from a vendor guide.

What people report works

What developers shared on X about agents in real repos.

Peter Steinberger@steipete
Reported on X
Peter Steinberger, who created OpenClaw, says the project deleted about 400k lines of its own tests with little change in coverage, because "modern models just love writing tests for every tiny change, even if they aren't useful." He says a skill helped.
noko@nokoxyz
Reported on X
noko says agents can still delete files: "i tried 19 ways, 8 got through." What held up for the author was one folder per agent, a CLAUDE.md for the job, a memory file it reads first and a log file it writes when done.
Ado@adocomplete
Reported on X
Ado says each Claude Code session starts with only the system prompt and tools, so project-wide context belongs in CLAUDE.md (or AGENTS.md) at the repo root.

Posts found by our X research for Sep 16 to Nov 15, 2026. Likes and bookmarks as of Nov 15, 2026. Results are what the authors say; we did not reproduce them. Promotional and engagement-bait posts were left out.

Sources

All read on Nov 15, 2026. "Undated" means the page shows no date. Vendors change these pages often; tell us on X if one moved.

The weekly diff

What changed in AI coding plans: prices, limits, resets. There's no email list: follow on X or subscribe to an RSS feed.

Follow @QuietlyByG on X What’s New RSSLimit & reset changes

No email form, so we don't collect any email addresses.