Title: docs: explain git identity and credentials in shared workspaces · Issue #30278 · coder/coder · GitHub
Open Graph Title: docs: explain git identity and credentials in shared workspaces · Issue #30278 · coder/coder
X Title: docs: explain git identity and credentials in shared workspaces · Issue #30278 · coder/coder
Description: Problem Shared workspaces covers roles, app routing, and sharing policies, but doesn't explain whose git identity and credentials are used when multiple users connect to the same workspace. In practice, everything resolves to the workspa...
Open Graph Description: Problem Shared workspaces covers roles, app routing, and sharing policies, but doesn't explain whose git identity and credentials are used when multiple users connect to the same workspace. In prac...
X Description: Problem Shared workspaces covers roles, app routing, and sharing policies, but doesn't explain whose git identity and credentials are used when multiple users connect to the same workspace. In ...
Opengraph URL: https://github.com/coder/coder/issues/30278
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"docs: explain git identity and credentials in shared workspaces","articleBody":"## Problem\n\n[Shared workspaces](https://coder.com/docs/user-guides/shared-workspaces) covers roles, app routing, and sharing policies, but doesn't explain whose git identity and credentials are used when multiple users connect to the same workspace. In practice, everything resolves to the **workspace owner**:\n\n- **Commit author/committer**: templates typically set `GIT_AUTHOR_*` / `GIT_COMMITTER_*` on the agent from `data.coder_workspace_owner.me` (e.g. [`examples/templates/docker/main.tf`](https://github.com/coder/coder/blob/main/examples/templates/docker/main.tf#L50-L53)). These are set at build time, so commits from any shared user are attributed to the owner.\n- **Git over SSH**: `agentGitSSHKey` returns the owner's key via `GetGitSSHKey(ctx, workspace.OwnerID)` ([`coderd/gitsshkey.go`](https://github.com/coder/coder/blob/main/coderd/gitsshkey.go#L148)).\n- **External auth**: `workspaceAgentsExternalAuth` resolves tokens with `UserID: workspace.OwnerID` ([`coderd/workspaceagents.go`](https://github.com/coder/coder/blob/main/coderd/workspaceagents.go#L2285-L2287)), so HTTPS git / `gh` operations act as the owner.\n\nA user with the `use` role gets SSH/terminal access, which is enough to push with the owner's SCM permissions. Owners sharing a personal workspace may not realize this.\n\n## Proposed docs changes\n\nAdd a section to `docs/user-guides/shared-workspaces.md` (and link it from `docs/tutorials/persistent-shared-workspaces.md`) that covers:\n\n1. Git identity, the git SSH key, and external auth tokens all belong to the workspace owner, for every connected user.\n2. Security implications of sharing a personally owned workspace (shared users can act with the owner's SCM credentials).\n3. Recommendation: use a service-account-owned workspace for shared or long-lived use cases, and note that activity will be attributed to the service account.\n4. How shared users can commit/push as themselves, e.g. overriding `GIT_AUTHOR_*` / `GIT_COMMITTER_*` in their session (template env vars take precedence over `git config`), or `git -c user.name=... -c user.email=...`, plus authenticating with their own credentials (e.g. `gh auth login`). Mention the trade-offs: credentials written to disk can be seen by other users of the workspace.\n\nCreated on behalf of @ericpaulsen\n","author":{"url":"https://github.com/apps/coder","@type":"Person","name":"coder"},"datePublished":"2026-10-02T07:39:06Z","url":"https://github.com/coder/coder/issues/30278"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6ad3b7e1-c6d9-2e07-6e0b-241f6051b5f1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBCE:76F02:1958BA3:20714AA:6B013CA8 |
| html-safe-nonce | 88de1ae2fc4359603eee3dd2961586d95e392742f76416e0fc37d990bacf88d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkNFOjc2RjAyOjE5NThCQTM6MjA3MTRBQTo2QjAxM0NBOCIsInZpc2l0b3JfaWQiOiI3Njk3MTkzODk3MjE4MzU4NDQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 44f5dd43a3f744e6b1d0aa4f9c677bacf4c7f5f46612820c328670385152c1f5 |
| hovercard-subject-tag | issue:5674400127 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/30278/issue_layout |
| twitter:image | https://opengraph.githubassets.com/434991c37a7b7dc538ef08ce09c56a4dfdd5ad5d7db46b626b9814dd94055b3a/coder/coder/issues/30278 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/434991c37a7b7dc538ef08ce09c56a4dfdd5ad5d7db46b626b9814dd94055b3a/coder/coder/issues/30278 |
| og:image:alt | Problem Shared workspaces covers roles, app routing, and sharing policies, but doesn't explain whose git identity and credentials are used when multiple users connect to the same workspace. In prac... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | coder[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width