Earn it: GitHub Achievements Academy home

Repo 5: Team and client projects

When several people, or a paying client, depend on a repo, the setup shifts from "easy to share" to "hard to break, clear who owns what, and safe to hand over." This applies to company apps, agency client sites and freelance projects alike.

Put it in an organization

Create a free organization (your profile menu → Your organizations → New organization) for your team, agency or client, rather than a personal account.

  • The repo survives people leaving
  • You give access by team ("Developers: write", "Client: read") instead of person by person
  • Handing a project to a client is a clean ownership transfer of the repo or the whole org

Freelancers and agencies: decide in your contract who owns the repo and when it transfers. A common pattern is to build in your agency's org, then transfer the repo to the client's org at handover (Settings → General → Transfer ownership). Issues, PRs, stars and history move with it.

Access: least privilege

RoleCanGive it to
ReadView and clone, open issuesClients who want visibility, auditors
TriageManage issues and PRs, no codeProject managers
WritePush branches, merge where rules allowDevelopers
MaintainManage the repo without destructive settingsTech leads
AdminEverything, including deletingAs few people as possible

Review access every few months, and when someone leaves the project.

Protect the branches that matter

A ruleset on main (and any release/* branches):

  • Require a pull request with at least 1 approval (2 for critical systems)
  • Require review from Code Owners (CODEOWNERS)
  • Require status checks: tests, lint and build
  • Block force pushes and deletions
  • Optionally require signed commits or linear history

Rulesets for private repositories need a paid plan, while public repositories get them free. Check GitHub's current plans for your situation.

Environments: control deployments

Under Settings → Environments, create staging and production:

  • Required reviewers: a named person must approve before a job deploys to production
  • Environment secrets: production credentials are only available to jobs that target production
  • Deployment branches: only main may deploy to production
jobs:
  deploy:
    runs-on: ubuntu-latest
    environment: production    # waits for approval, then gets production secrets
    steps:
      - uses: actions/checkout@v7
      - run: ./deploy.sh
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}

Prefer OIDC (short-lived credentials) over long-lived keys when your host supports it. Most major clouds do.

A branching strategy everyone understands

StrategyHow it worksGood for
GitHub FlowShort branches off main, PR, review, merge, deployMost teams and websites
Trunk-basedVery small PRs merged many times a day, with feature flags for unfinished workFast-moving product teams
Release branchesrelease/2.4 branches for maintaining old versionsSoftware with several supported versions

Pick one, write it in CONTRIBUTING.md, and enforce it with rulesets.

Write down how the project works

Clients and new teammates shouldn't have to ask:

  • README: what it is, how to run it locally, where it's deployed
  • docs/deploy.md: how releases happen, and how to roll back
  • .env.example: every environment variable with a fake value (never real ones)
  • Issue labels and a project board (GitHub 2) so the client can see progress

Handover checklist (client projects)

Exercise

  1. Create a free organization and move (or create) a practice repo in it.
  2. Make a team with Write access and add yourself.
  3. Add a ruleset requiring a PR and one passing check on main.
  4. Create a production environment with yourself as the required reviewer.

What you learned

  • Organizations, teams and least-privilege access
  • Rulesets and environments that keep production safe
  • Branching strategies, project docs and a clean client handover

Next: Repo 6: WordPress plugins and themes

Check what you learned

1. Why put client or team work in an organization instead of a personal account?
2. What can a GitHub environment named production enforce?
3. Which role should most developers get?

Show the answers
  1. Access is managed by teams, and the repo survives people leaving or can be transferred cleanly: Ownership and access shouldn't depend on one person's account.
  2. Required reviewers before deploying, and its own secrets: Jobs targeting the environment wait for approval and only then get its secrets.
  3. Write: Least privilege: give admin to as few people as possible.

Your progress is saved in this browser only.

Last reviewed November 2026. Improve this page on GitHub. Every fix you send counts toward Pull Shark.