Adds a **Git identity and credentials** section to the shared workspaces
guide and links it from the persistent shared workspaces tutorial.
Every user of a shared workspace uses the owner's Git identity, Git SSH
key, external auth tokens, and user secrets, and the docs didn't say so.
Closes#30278.
Refs ENG-3444.
## Changes
- `docs/user-guides/shared-workspaces.md`: new section that covers what
resolves to the owner, the security implications, the service account
recommendation, and how a shared user commits and pushes as themselves,
with trade-offs.
- `docs/tutorials/persistent-shared-workspaces.md`: two sentences after
the service account step that link to the new section.
## Where this differs from the issue
- The issue suggests `git -c user.name=... -c user.email=...`.
It has no effect when the template sets `GIT_AUTHOR_*` and
`GIT_COMMITTER_*`, because Git env vars beat all config, including `-c`.
The docs say this and recommend exporting the env vars or using `git
commit --author` instead.
- Service accounts have no email address and can't sign in to the
dashboard, so the docs don't claim the Git provider attributes activity
to the service account.
The docs say what commits look like and suggest putting the service
account's `coder publickey` on a dedicated machine account.
- Added user secrets to the list of owner-scoped things, since
`docs/user-guides/user-secrets.md` already warns about this.
## Testing
- Code sources: `coderd/gitsshkey.go` (`GetGitSSHKey(ctx,
workspace.OwnerID)`), `coderd/workspaceagents.go` (external auth links
looked up by `workspace.OwnerID`), `agent/agent.go` (`GIT_SSH_COMMAND`,
env precedence), `cli/agent.go` (`GIT_ASKPASS`), `cli/ssh.go`
(`--forward-agent`), `examples/templates/docker/main.tf`.
- Ran with Git 2.53.0: exported `GIT_*` vars beat `git -c user.*`,
`--author` changes only the author, and an empty `GIT_AUTHOR_EMAIL`
produces `name <>`.
- `markdownlint-cli2`, `make lint/emdash`, and Vale pass on both files.
The pre-commit hook passed.
<details>
<summary>Not verified end to end (please check)</summary>
- I didn't test SSH agent forwarding (`coder ssh --forward-agent` plus
`export GIT_SSH_COMMAND=ssh`) against a real Git provider from a shared
workspace.
- I didn't run `gh auth setup-git` taking priority over Coder's
`GIT_ASKPASS` in a workspace.
This is based on Git's documented credential order: helpers first, then
askpass.
- I didn't check in a running deployment that `coder publickey` works
with a service account token.
</details>
---
_Generated by Coder Agents on behalf of @nickvigilante._