Repository navigation
Manage Desktop commit authorship by account - #23229
Merged
Merged
Conversation
Retain credential-free authorship preferences, apply repository-scoped Git and Copilot environments, and provide compact inline identity editing. Co-authored-by: Copilot App <[email protected]>
Explain Git configuration and per-account identities with persistent accessible descriptions while retaining compact inline editing. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Explain account-scoped identity edits and signed-out attribution limits, keep popover actions inline, and prioritize exact registered checkout assignments over worktree aliases. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unconditional identity resolution can block repository reads and falsely mark valid checkouts missing, while unnecessary live lookup can abort assisted runs that already supply frozen identity values.
2 open issues
What changed in this PR
Adds opt-in, account-scoped commit identities to GitHub Desktop while keeping Git configuration as the default and leaving other Git applications unaffected.
Changes:
- Retains credential-free identities after sign-out, with profile defaults and per-field overrides.
- Applies repository-assigned identities to Git and Copilot child processes, capturing identity variables for assisted runs.
- Adds staged identity editors, account-aware attribution guidance, documentation, and regression tests.
| File | Description |
|---|---|
| docs/technical/oauth.md | Documents managed identities and attribution behavior. |
| app/test/unit/ui/managed-commit-identity-test.tsx | Tests identity editors, mode selection, and validation. |
| app/test/unit/ui/commit-message-test.tsx | Tests managed and unassigned attribution controls. |
| app/test/unit/ui/commit-message-avatar-test.tsx | Tests account-aware popovers and email selection. |
| app/test/unit/stores/copilot-store-credentials-test.ts | Tests authorship in isolated planning environments. |
| app/test/unit/stores/app-store-accounts-test.ts | Tests assignment-based identity and worktree precedence. |
| app/test/unit/managed-commit-identity-test.ts | Tests persistence, profile refreshes, and overrides. |
| app/test/unit/git/managed-commit-identity-test.ts | Tests Git authorship and assisted-run identity snapshots. |
| app/test/unit/accounts-store-test.ts | Supplies a valid account endpoint in a fixture. |
| app/styles/ui/_radio-button.scss | Styles radio-button descriptions. |
| app/styles/ui/_preferences.scss | Styles compact identity summaries and editors. |
| app/styles/ui/_dialog.scss | Enables scrolling in Git preferences. |
| app/styles/ui/_commit-message-avatar.scss | Aligns managed-identity action buttons. |
| app/src/ui/repository.tsx | Passes identity mode to the changes sidebar. |
| app/src/ui/repository-settings/repository-settings.tsx | Integrates managed identities into repository settings. |
| app/src/ui/repository-settings/git-config.tsx | Displays managed identity instead of Git configuration controls. |
| app/src/ui/preferences/preferences.tsx | Stages and saves identity preferences. |
| app/src/ui/preferences/git.tsx | Adds mode selection and inline identity editors. |
| app/src/ui/lib/radio-group.tsx | Supports descriptions for individual choices. |
| app/src/ui/lib/radio-button.tsx | Exposes supporting text as accessible descriptions. |
| app/src/ui/index.tsx | Registers repository-scoped identity lookup. |
| app/src/ui/dispatcher/dispatcher.ts | Routes identity and email updates to AppStore. |
| app/src/ui/commit-message/commit-message-dialog.tsx | Connects dialogs to managed authorship controls. |
| app/src/ui/changes/sidebar.tsx | Forwards identity mode to the changes list. |
| app/src/ui/changes/filter-changes-list.tsx | Wires identity mode and email updates into commits. |
| app/src/ui/changes/commit-message.tsx | Connects attribution UI to account identities. |
| app/src/ui/changes/commit-message-avatar.tsx | Adds managed-identity and signed-out guidance. |
| app/src/ui/app.tsx | Supplies identity settings to application views. |
| app/src/lib/stores/git-store-cache.ts | Exposes the latest cached repository association. |
| app/src/lib/stores/copilot-store.ts | Adds repository authorship to Copilot environments. |
| app/src/lib/stores/app-store.ts | Resolves identities and coordinates authorship updates. |
| app/src/lib/stores/accounts-store.ts | Persists and refreshes credential-free identities. |
| app/src/lib/managed-commit-identity.ts | Defines identity models, validation, and environment mapping. |
| app/src/lib/git/spawn.ts | Adds managed identity variables to spawned Git processes. |
| app/src/lib/git/core.ts | Merges managed identity into Git execution environments. |
| app/src/lib/git/assisted-commit/git.ts | Captures identity variables for private assisted execution. |
| app/src/lib/app-state.ts | Adds identity settings to shared application state. |
Review effort: Balanced
sergiou87
previously approved these changes
Nov 25, 2026
Resolve managed identities only for mutations and identity queries. Honor complete caller-supplied identity environments, including explicit unset keys, and preserve frozen identities during assisted ref publication and rollback. Co-authored-by: Copilot App <[email protected]>
Preserve managed commit identity propagation alongside the updated Copilot request implementation. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
tidy-dev
approved these changes
Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes github/gh-cli-and-desktop#382
Relates to github/gh-cli-and-desktop#375. External Git configuration management (github/gh-cli-and-desktop#386) remains separate work.
Description
Repositories assigned to different accounts need separate commit identities without changing the identity used by other Git applications. This adds an opt-in Use a separate identity for each account mode; Use Git configuration remains the default.
Managed mode does not write identity settings to Git configuration. Accounts already signed out before upgrading may need to sign in once to initialize a retained identity. Non-identity read-only Git commands remain available while an identity is missing or invalid; identity queries and mutations report the error instead of silently falling back to Git configuration. A custom email does not guarantee GitHub attribution.
Validation
Validated source is committed as
6c99bb01a9001a8306a6b76a25b8d3494766b449; the working tree is clean.GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all npm test- passed: 3,511 tests passed, 2 skipped, no failures. The command-local setting accommodates this machine's bare-repository policy; no persistent Git configuration was changed.node_modules/.bin/tsc --noEmit- passed.npm run lint:fixandnpm run lint- passed.Team-authored review
Evidence: Validation and screenshots.
Review path: Lightweight review. Managed authorship adds local, credential-free preferences and child-process identity variables without changing authentication or credential handling.
Screenshots
Git configuration mode with a compact identity editor
Per-account identity editing, including retained signed-out identities
Account-aware attribution popover
Release notes
Notes: [New] Configure a separate commit name and email for each repository's assigned account without changing other Git applications