This document covers how to grant collaborators push access and the recommended permission and branch-protection strategy.
Root-level GitHub settings baseline:
The direct approach is to add contributors as repository collaborators instead of sharing your account.
On the GitHub web UI:
- Open the repository
Settings - Go to
Collaborators and teams - Click
Add people - Enter the contributor's GitHub username
- Select a permission level
Recommended permissions:
Write: suitable for most contributors; lets them push their own branches and open PRsMaintain: suitable for leads or core maintainers
Generally avoid granting:
Admin
Recommended workflow:
- Everyone pushes to their own branch
- Nobody pushes directly to
main - All changes go through PRs merged into
main
Benefits:
- No accidental overwrites between contributors
- Each research track can be reviewed independently
- Easy to trace and revert changes
Enable branch protection for main in the repository settings.
Recommended rules:
- Block direct pushes to
main - Require Pull Request merges
- Require at least 1 review before merging
- Require the
unit-testsstatus check
The required unit-tests check is intentionally a fast PR gate. It runs public
documentation guards, Markdown link checks, Python syntax compilation, and a CLI
parser smoke without installing PyTorch or executing runtime tests. This keeps
PR iteration short and stable.
Full validation is still available, but it is not the default PR bottleneck:
full-checksruns automatically after merges tomainfull-checkscan be triggered manually withworkflow_dispatch- local behavior-changing PRs should run
python -X utf8 scripts/run_local_checks.py --fast
This split keeps the required status-check name stable while moving heavyweight dependency installation and runtime tests out of every PR commit.
For a smaller team, a lighter version works:
- Regular contributors go through the PR flow
- The owner can handle emergencies directly
Each contributor:
- Clones the repository
- Creates a personal branch
- Works in the relevant workspace and shared code directories
- Commits changes
- Pushes the branch
- Opens a PR
Suggested branch naming:
black-box/<topic>white-box/<topic>gray-box/<topic>implementation/<topic>
The local git commit email must match a verified email on the GitHub account, or use GitHub's noreply email.
Check current settings:
git config user.name
git config user.emailSet local identity for this repository:
git config user.name "Your GitHub name"
git config user.email "Your verified GitHub email"Future commits will use the corrected identity. Past commits keep their original identity; fixing those requires rewriting history and force-pushing, which needs careful coordination.
Current recommended setup:
- You are the repository owner
- Add core contributors as collaborators with
Writepermission - Protect
mainwith branch rules - Merge all changes through PRs after one human review and a passing
unit-testscheck
Additional notes:
- Repository-level Copilot review instructions live in
Research/.github/copilot-instructions.md - Copilot acts as a first-pass static check, not the final reviewer