You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
remote: Failed to authenticate user is a message from remote, and authorization is not handled by SourceGit (as I said above, SourceGit just tell git that credential-manager will used to do authorization jobs in communication with remote).
When you directly use git in command line, is it impossible to reproduce this issue?
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)
Activity
love-linger commentedon Dec 4, 2025
credential-manager-coreis no longer supported bygit. AndSourceGitusescredential-managerby default. Which version ofgitare you using?pabermod commentedon 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 REMOTEREPO
My git version is:
git version 2.51.0.windows.1
love-linger commentedon Dec 4, 2025
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?pabermod commentedon Dec 4, 2025
Hi,
I'm using gitea and I have found this:
https://techoverflow.net/2025/05/24/gitea-how-to-fix-authentication-failed-but-works-when-trying-again/
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)
love-linger commentedon Dec 4, 2025
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.
pabermod commentedon Dec 4, 2025
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!