|
| 1 | +# 14-git-and-github-workflow |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +This note defines the default collaboration workflow for repositories inside Codex Workspace. |
| 6 | + |
| 7 | +If a repo has clearer local guidance in `README.md`, `CONTRIBUTING.md`, `AGENTS.md`, or `HANDOVER.md`, follow that repo-local guidance first. |
| 8 | + |
| 9 | +This is an advisory baseline, not a requirement to give every repo the same GitHub setup. |
| 10 | + |
| 11 | +## Baseline rule |
| 12 | + |
| 13 | +Use the lightest collaboration surface that still keeps the work understandable and resumable. |
| 14 | + |
| 15 | +- Local docs are the default fallback for repos that are local-only or do not need a public collaboration queue. |
| 16 | +- GitHub Issues and Pull Requests are the default path for non-trivial work in repos that actually use GitHub. |
| 17 | +- GitHub Discussions are useful for questions and open-ended discussion when that repo has Discussions enabled. |
| 18 | +- `gh` is recommended convenience tooling, not a workspace requirement. |
| 19 | +- `gh auth login` is optional maintainer setup, not part of the clean-clone baseline. |
| 20 | + |
| 21 | +## Repo states |
| 22 | + |
| 23 | +### Local-only |
| 24 | + |
| 25 | +Use this when a repo is not meant to be shared through GitHub or when the work is still purely local. |
| 26 | + |
| 27 | +- Track meaningful work in `README.md`, `HANDOVER.md`, or a `Next Batches` section. |
| 28 | +- Use a local branch when the change is risky, long-running, or easier to review as a separate slice. |
| 29 | +- Do not force issues or PRs where a tracked local handover is enough. |
| 30 | + |
| 31 | +### Git-only |
| 32 | + |
| 33 | +Use this when the repo is under Git but has no GitHub remote that matters for the current work. |
| 34 | + |
| 35 | +- Keep the same local tracking path as `local-only`: `README.md`, `HANDOVER.md`, or `Next Batches`. |
| 36 | +- Prefer small focused branches for non-trivial work. |
| 37 | +- Treat Git history as the reviewable surface unless the repo later adopts a GitHub queue. |
| 38 | + |
| 39 | +### GitHub-backed |
| 40 | + |
| 41 | +Use this when the repo has a GitHub remote and real collaboration happens there. |
| 42 | + |
| 43 | +- Use GitHub Discussions for setup questions, usage questions, policy questions, and open-ended design discussion when that repo has Discussions enabled. |
| 44 | +- If Discussions is not enabled, use Issues for actionable work and keep broader local context in tracked docs until the repo defines a better question flow. |
| 45 | +- Use GitHub Issues for actionable bugs, focused enhancements, docs work, and tracked follow-up tasks. |
| 46 | +- Use Pull Requests for non-trivial code, docs, or workflow changes that should be reviewed as a unit. |
| 47 | +- A tiny obvious change can still go straight to a focused PR, but non-trivial work should usually have an issue or clear written problem statement first. |
| 48 | + |
| 49 | +### Fork and upstream |
| 50 | + |
| 51 | +Use this when the repo has both a writable fork and a separate upstream remote. |
| 52 | + |
| 53 | +- Keep your working branch on the writable remote. |
| 54 | +- Reference upstream issues when the work is really for upstream rather than only for the fork. |
| 55 | +- Open the PR against the repo that should actually receive the change. |
| 56 | +- Only use closing keywords when the PR targets the same repo that owns the issue. Otherwise use a non-closing reference such as `Refs #123`. |
| 57 | + |
| 58 | +## Default flow for non-trivial work |
| 59 | + |
| 60 | +1. Check whether repo-local docs override this workspace baseline. |
| 61 | +2. Choose the tracking surface: |
| 62 | + - local docs for local-only or git-only work |
| 63 | + - Discussions for open-ended questions or policy discussion when the repo has Discussions enabled |
| 64 | + - Issues for scoped actionable work |
| 65 | +3. Create a focused branch when the work is more than a tiny direct fix. |
| 66 | +4. Make the change, run the narrowest useful verification, and record what was checked. |
| 67 | +5. Close out on the matching surface: |
| 68 | + - update `README.md`, `HANDOVER.md`, or `Next Batches` for local-only or git-only repos |
| 69 | + - open or update a PR for GitHub-backed repos |
| 70 | + |
| 71 | +## Branch guidance |
| 72 | + |
| 73 | +These names are guidance, not enforcement. |
| 74 | + |
| 75 | +- Prefer short descriptive prefixes such as `docs/`, `fix/`, `feat/`, or `chore/`. |
| 76 | +- If there is an issue number, include it when helpful, for example `fix/123-preview-routing`. |
| 77 | +- Keep one branch focused on one reviewable outcome. |
| 78 | + |
| 79 | +## Issue, PR, and closeout guidance |
| 80 | + |
| 81 | +- Link the issue, discussion, or brief problem statement in the PR description. |
| 82 | +- Use closing keywords such as `Closes #123` only when merging that PR should close the issue in the same target repo. |
| 83 | +- Use non-closing references such as `Refs #123` when the issue lives in another repo, when the PR targets a fork first, or when more work remains. |
| 84 | +- Close the issue when the accepted change actually lands, not when a branch merely exists. |
| 85 | +- For local-only or git-only repos, record equivalent closeout context in tracked docs instead of inventing a fake issue queue. |
| 86 | + |
| 87 | +## What this baseline does not require |
| 88 | + |
| 89 | +- GitHub Projects |
| 90 | +- a uniform label set across every repo |
| 91 | +- repository rulesets beyond what an individual repo wants |
| 92 | +- a PR-only workflow for local-only repos |
| 93 | +- `gh auth login` on every machine |
| 94 | + |
| 95 | +## Common workspace scenarios |
| 96 | + |
| 97 | +### Codex Workspace root repo |
| 98 | + |
| 99 | +- Use the root issue templates, contributor guide, and PR template. |
| 100 | +- Route setup and usage questions toward Discussions Q&A. |
| 101 | +- Use issues and PRs for non-trivial workspace docs, tooling, and `workspace-hub` changes. |
| 102 | + |
| 103 | +### Normal GitHub-backed sibling repo |
| 104 | + |
| 105 | +- Use the repo's own docs first. |
| 106 | +- If it has no clearer collaboration doc, use this baseline: issue for scoped work, branch for implementation, PR for reviewable change, and Discussions only when that repo has them enabled. |
| 107 | + |
| 108 | +### Fork with upstream |
| 109 | + |
| 110 | +- Keep the fork writable and upstream clean. |
| 111 | +- Track upstream-facing work against the upstream issue when relevant. |
| 112 | +- Avoid accidental upstream auto-close language from fork-only PRs. |
| 113 | + |
| 114 | +### Local-only git repo |
| 115 | + |
| 116 | +- Keep the queue in tracked local docs. |
| 117 | +- Use branches and commits as the review surface. |
| 118 | +- Promote the repo to a GitHub-backed workflow only when that actually helps collaboration. |
0 commit comments