Skip to content
papuh

From the workshop

GitHub for non-programmers: backup, memory and safety net

What git and GitHub are good for when AI agents do most of the work, and the rules I gave them so they do not cause damage in the repository.

As of November 2026. The commands in this article are generic, the folder names are made up.

The situation

Most of my repository is not code. It is text files: rules, tasks, notes, decisions, article drafts. AI agents work in them, often several at once and often without me. So I need three things: nothing gets lost, I know who changed what, and a mistake can be undone.

That is exactly what git does. GitHub is a place on the internet where the history from git is pushed and backed up. My repository on GitHub is private.

What I gave the AI and what I did not

The agent saves changes on its own, without asking, as soon as it has a finished logical unit. Without that the history would be unreadable and at the end of the day I would be approving hundreds of small things.

I kept two things: pushing changes that deploy code other people use, and deciding what to do with a finding when the check before saving hits something sensitive.

Why not a shared drive

A cloud-synced drive backs up files, but it does not keep a line-by-line history of changes. On top of that, in a conflict it creates a copy with the suffix “(1)”. When such a drive also syncs the inside of a git folder, git gets lost in those copies. On 9 September 2026 such files blocked my push to GitHub. Since then the rule is that the repository does not belong on a synced drive. Neither does the data kept outside git.

Three words are enough

  • Commit is a saved change with a description. You can always see exactly what it changed, and it can be undone.
  • Branch is a separate line of work. The agent works on its project’s branch and leaves the main branch alone.
  • Merge carries finished work from a branch into the main branch. Everything that runs on its own for me reads only the main branch, so whatever stays on a branch does not exist for the system.

One task for me looks like this: the agent works on the project branch, saves a commit after each logical step, at the end of the task the branch is merged into the main one, and the result is pushed to GitHub. Details on branches are in the episode about workspaces.

Five rules for the agent

Rule Why What would happen without it
Save on your own, after each logical unit the history can be read step by step and each step can be undone either one huge change at the end, or work left unsaved
Save only the files you changed and name them; never “everything” parallel sessions run on the repository the agent saves someone else’s unfinished work under its own description
Description in the form project: what was done the history shows which project a change belongs to a history full of “changes” and “fix”
Before saving, check the changes for passwords and personal data what goes into the history once is hard to get out a password in the history on GitHub
Push to GitHub right after saving the backup exists only once it is pushed the work exists on one laptop only

A file the agent does not know the origin of is not saved. The agent lists it and leaves it to me.

The exception: a push that deploys

For two folders with code, a push to GitHub does more than back up: a deployment tool immediately builds a new version from it and releases it to people. There a human decides about the push, not the agent.

So before every push the agent first fetches the current state from GitHub and then, as a separate command, lists whether any of the unpushed changes touch those folders:

git fetch origin main
git log --oneline origin/main..main -- priecinok-s-kodom-1 priecinok-s-kodom-2

If the second command prints anything, the push waits for me and the agent tells me what would be deployed. The first command is there because without it the comparison is made against an outdated state. Once an automatic routine stopped a push because of a change that was already on GitHub.

What never goes into the repository

The repository is in the cloud, AI reads it, and I look into it from my phone too. So it does not contain:

  • passwords, keys, certificates, tokens and access credentials,
  • public IP addresses and device configuration exports,
  • client names,
  • bank statements and accounting receipts.

Large and binary files (presentations, PDFs, exports) live in an attachments folder that is entirely outside git. Git holds only a list of what is in it. Data that apps need to run sits in a separate folder outside the repository and outside any synced drive. Passwords are in the system keychain, never in a file, a conversation or a log.

The check has two levels. A quick one runs before every save and looks only at the changes. A full one goes through the whole repository once a month. A finding is reported as file, line and type, never the full value found.

Several repositories, no carrying over

I have three repositories, each with its own rules file. Tools may be shared between them; content is not carried over in either direction. An agent working in one must not copy notes, names or data into another. The rule is written in each of them, because an agent reads only the repository it is in.

GitHub Actions in plain words

GitHub Actions is a robot that does something on GitHub’s servers after changes are pushed or at a set time. For me, for example, it sends an email with the daily AI briefing or deploys this website. The advantage is that it does not depend on my laptop being on.

The repository from a phone

When I am away from the computer, I ask Claude in the chat on my phone. It reads the repository through GitHub, so it can tell me what state a project is in or what was decided. That works only for what is in git and has been pushed. Attachments outside git are not visible from the phone.

What went wrong

  • A password in the source material. On 24 August 2026 the check before pushing found a password in the source material before it went to GitHub for the first time. Since then every diff is checked before saving.
  • A push that deployed unfinished code. A push to GitHub once deployed code that was not finished yet. Since then the “what will be deployed” check is a separate step, and for code a human decides.
  • “(1)” files. Copies from drive syncing inside the git folder blocked a push (9 September 2026).

How to check

Before pushing to GitHub from a repository that deploys:

git fetch origin main
git log --oneline origin/main..main -- priecinok-s-kodom

If the second command prints nothing, the push deploys nothing from the code. If it does, I look at what it is before I let the push go.

What to watch out for

  • History is irreversible. What goes to GitHub once stays in the history even after the file is deleted. The check has to happen before saving, not after.
  • A private repository is not a vault. It is only a smaller circle of people who can see it. Passwords do not belong there either.
  • “Save everything” is a trap. With parallel sessions it also takes work that is not finished.
  • A push is not always a backup. You need to know which folders deploy something after a push.

Takeaways

Git is not only for programmers. When working with agents it is memory and an emergency brake: everything an agent does can be seen and undone, as long as it saves in small pieces and only its own files. The most important rules are short: save in units, name the files, check before saving, and know which push deploys.

Exercise for today: in one folder where AI works, run git log --oneline -20 and see whether the descriptions explain what happened over the last few days. If not, the first rule for the agent is the format of the description.

Sources

Previous episode: Orca from A to Z. Next episode: While I sleep: the batch and the checker.

I prepared this text with the help of AI from my own notes.