Multi-org profiles

You contribute skills to your employer's hub and to your own. The two need different commit emails, different remotes, and — the part that bites — you never want a work skill pushed to the personal hub by accident. A profile bundles an identity with its remotes; switch profiles and everything follows.

One profile per org

quay profile add work --email you@acme.dev \
  --remote hub=git@github.com:acme/skills-hub.git --default

quay profile add personal --email you@hey.com \
  --remote hub=git@gitlab.com:you/skills.git --provider gitlab --default \
  --activate

Both profiles can call their remote hub — remotes are scoped to the profile. --provider, --push-mode, --direct-branch and --default apply to the --remote written just before them. quay profile add -i asks the same questions one at a time if you'd rather not type URLs on a command line.

Pick the profile

Four ways, highest priority first:

HowScope
--profile workThis one command.
QUAY_PROFILE=workThis shell, or one CI job.
profile = "work" in the project's .quay/config.tomlEveryone working in this repo.
quay profile use workYour machine, until you switch again.

The project pin is the one that prevents the accident: commit it in your employer's repos and quay push there resolves to work no matter what you last ran profile use on.

# .quay/config.toml
profile = "work"

Check where you are

quay profile current     # the name that resolves here
quay profile show work   # that profile's email, remotes and push modes
quay profile list        # all of them, active one marked

Run current from inside the repo — it accounts for the project pin and QUAY_PROFILE, which profile list and a bare profile show do not. Pass show the name current printed; with no name it shows active_profile.

Gotchas

  • quay remote add|edit|remove currently drop the pin. They rewrite .quay/config.toml without the top-level profile = "…" line — re-add it after changing remotes, and check git diff before committing.
  • A pinned profile must exist. If .quay/config.toml pins work and your user config has no profile by that name, quay errors instead of falling back. That's deliberate; create the profile.
  • More than one profile and nothing selected is an error, not a guess. With exactly one profile, it's used automatically.
  • The commit author name isn't a flag. --email sets the email; the name comes from name under [profiles.<name>.user] in ~/.config/quay/config.toml, and is a placeholder until you set it there.
  • quay remote add does not touch profiles. It writes the project config. To change a profile's remotes, use quay profile edit <name> -i or --from-toml.
  • Two keys for one host. If both orgs live on github.com under different SSH keys, see SSH key setup.