Skip to content

Section 3 - Start each change safely

Start every authoring session from a clean branch. This protects other work and keeps your pull request focused.

You do not need to memorize the Git commands. Ask Codex to do the setup and explain what it is doing.

Think of a branch as your private workspace for one change. It does not affect the published site. It does not affect main. It gives reviewers a clean set of edits to inspect later.

Use one branch per topic or closely related set of edits. If you are updating two unrelated topics, use two branches and two pull requests.

For more detail about branches, commits, pushes, pull requests, and automated checks, see Automated checks and review signals.

Before editing, paste this into Codex:

I want to work on a service_docs topic.
Update main and create a new branch.
If there are uncommitted changes, stop and explain what files are changed before doing anything else.
Do not edit documentation yet.

Codex may ask for permission before it updates main or creates the branch. Not every user will see these prompts.

  • If you see a prompt to update the local main branch from origin: Confirm that the command shown is git pull --ff-only, then select Allow once.

    Update local main permission exampleCodex permission prompt asking to run git pull --ff-only to update the local main branch from origin.
  • If you see a prompt to create and switch to a new branch: Confirm that the command begins with git switch -c and that the branch is not named main, then select Allow once.

    Create and switch branch permission exampleCodex permission prompt asking to create and switch to a new topic-authoring branch with git switch -c.

If the command is different from the expected command, select Deny and ask Codex to explain why it needs that command.

Codex should confirm:

  • which branch you are on
  • whether there are uncommitted changes
  • whether main is up to date
  • the new branch name

If Codex says there are uncommitted changes, pause. Those edits might be yours from a previous session, or they might belong to someone else using the same workspace. Ask Codex to explain the changed files before you continue.

Once Codex has created the branch, you can start the actual authoring request. See Author with Codex.

You can see which branch you are on, or if you are on main, by looking in the bottom left corner of the window.

VS Code status bar showing the current branch in the bottom left corner