TortoiseGit lacks automatic handling of expired HTTPS credentials stored in Windows Credential Manager
0 reputation · 13 Aug 2021, 18:10 UTC
0 reputation · 13 Aug 2021, 18:10 UTC
TortoiseGit stores HTTPS credentials in Windows Credential Manager, supporting repository‑scoped or global scopes for least‑privilege access, but it does not automatically detect when those credentials expire and provides no visual cue that they are stale, resulting in silent authentication failures during push or pull operations. How can TortoiseGit automatically verify the validity of stored credentials before each HTTPS request and surface a clear indicator of staleness in the UI while preserving the existing scope boundaries?
TortoiseGit does not automatically verify stored HTTPS credentials before each request, and stock builds do not show a UI staleness indicator. When credentials expire, the remote operation usually fails after the server rejects them. The practical fix is to remove the stale entry from Windows Credential Manager so TortoiseGit re-prompts, optionally preceded by a manual pre-flight command.
TortoiseGit passes the stored credential to Git or libgit2 at request time. Windows Credential Manager returns the stored blob without an expiry check, so staleness is discovered only when the remote server returns an authentication failure. Behavior after that failure—re-prompting versus silent failure—depends on the TortoiseGit and credential-helper configuration.
git:https://<host> entry for the failing repository, or the generic git:https:// entry if you are using a global credential.git ls-remote https://<host>/<repo> HEAD. If it requests credentials or fails, the stored entry is stale.Remove only the entry matching the failing repository URL. Repository-scoped credentials are checked independently of global ones, so deleting a repository-specific entry does not affect other hosts.
After removing the stale entry, perform a pull or push. Confirm that TortoiseGit opens the credential dialog for that repository and that the operation succeeds after entering fresh credentials.
Missing diagnostic detail: Does TortoiseGit currently re-prompt for credentials after a 401 response, or does the operation fail without prompting? This determines whether a proactive check would add value or duplicate existing behavior.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.