Repository navigation
Random push authentication error #1953
Description
Activity
credential-manager-coreis no longer supported bygit. AndSourceGitusescredential-managerby default. Which version ofgitare you using?- addedneed-more-infoExtra information or replay is neededExtra information or replay is needed
on Dec 4, 2025 I changed to credential-manager and i'm still getting random errors (now without the first line)
remote: Failed to authenticate user
fatal: Authentication failed for 'REMOTEREPO'
Pushing to REMOTEREPOMy git version is:
git version 2.51.0.windows.1
remote: Failed to authenticate useris a message from remote, and authorization is not handled bySourceGit(as I said above,SourceGitjust tellgitthatcredential-managerwill used to do authorization jobs in communication with remote).When you directly use
gitin command line, is it impossible to reproduce this issue?Hi,
I'm using gitea and I have found this:
I think the problem may come from this.
I think if I use a ssh key instead of oauth2 i won't have this problem, right?
Maybe SouceGit should retry once to force refresh the token? (Or check the expiration of the token and refresh it before pushing (for example if the token will expire in the next 30 seconds)
When error occurs,
SourceGitcan not know what's the output message means...For example, the remote may returns
fetch firsterror, which means you should fetch remote first and then rebase your changes and then retry push.For most conditions, always retrying is not a right way.
You are right, you don't know why authentication failed.
The problem is with git credential manager. They have a PR open to auto refresh the token:
git-ecosystem/git-credential-manager#1837
I'll use an SSH key for now.
Thanks!
Reacted by leo
Hi,
When pushing commits to a remote origin, some times I get a authentication error. If I try again it pushes correctly.
This happens many times.
The error is:
git: 'credential-manager-core' is not a git command. See 'git --help'.
remote: Failed to authenticate user
fatal: Authentication failed for 'REMOTEREPO'
Pushing to REMOTEREPO