'credential-manager' is not a git command
Asked Answered
R

12

45

Am on Windows 10 64-bit running git version 2.33.1.windows.1 against Azure repos. Since my last update I get the following error when cloning a rep using TortoiseGit v2.13.0.1 (latest version).

git.exe clone --progress -v "https://[email protected]/FenergoProduct/FlareDocumentation/_git/FlareFenergoRegulationMargin" "C:\Flare\FlareFenergoRegulationMargin"
Cloning into 'C:\Flare\FlareFenergoRegulationMargin'...
git: 'credential-manager' is not a git command. See 'git --help'.

The most similar command is
credential-manager-core

Does anyone have a simply explanation of how to get rid of this?

Rika answered 20/4, 2022 at 13:57 Comment(8)
Try git config --global credential.helper manager-core.Beastings
Thanks - unfortunately that doesn't seem to work (note the command doesn't give any output): $ git config --global credential.helper manager-core $ git pull git: 'credential-manager' is not a git command. See 'git --help'. The most similar command is ` credential-manager-core` Already up to date.Rika
It seems something is wrong with your Windows Credential Manager. Try git config --global credential.helper store. It stores the username and password/token in ~/.git-credentials by default. If you don't want the credential helper, you could also run git config --global --unset credential.helper to disable it.Beastings
When I run "git config --global credential.helper store" I don't get any output, what should I see?Rika
It does not print anything. Try git clone and it's expected to ask for username and password/token for once.Beastings
I tried completely uninstalling then reinstalling Git with no results. When I look at Credential Manager in Windows I see under "Generic Credential" a number of values prefixed with "git:". Should I remove these and try again?Rika
I further tried the following: 1) Deleted Git entirely, including related files in C:\Users\<username> such as .gitconfig. 2) Removed any git credentials from the Windows Credential Manager. 3) Reinstalled git. 4) Ran "git credential-manager-core unconfigure " 5) Ran (as suggested above) git config --global credential.helper store. 6) Ran (as suggested above) git config --global --unset credential.helper. In all cases I still get the error in the thread subject line when I run a "git pull"Rika
What does git config --show-origin credential.helper print? If it's not empty, it shows the value of credential.helper and in which file it's configured.Beastings
G
44

I started getting the same error messages for every service after my last upgrade. I made them go away by creating an alias for credential-manager.

git config --global alias.credential-manager "credential-manager-core"

Other than the error messages, the credential-manager seems to have been working correctly both before and after creating the alias.

Grigson answered 27/7, 2022 at 13:30 Comment(3)
Thanks man! I've tired trying to fix that issue.Photomechanical
I tried that, didn't work for me on a remote linux machineDemijohn
This didn't work for me in 2.44.0.windows.1, but below by @teemo did, https://mcmap.net/q/366612/-39-credential-manager-39-is-not-a-git-commandAbbreviate
L
40

Execute git config --global -e and remove this line in the editor:

credential.helper=manager-core

-e means edit.

Lentiginous answered 28/2, 2023 at 20:15 Comment(4)
great one! fixed it here... I was messing up with git and got in this situation. :DAnguiano
Apparently it was renamed from manager-core to manager in 2.39. Hence removing this old 'manager-core' helps, just as changing it to 'manager' would (until they change it again...)Abbreviate
See also https://mcmap.net/q/374049/-how-to-fix-git-for-windows-keeps-asking-for-github-credentialsAbbreviate
The -e option will open an editor (whatever editor you set in git, or the default vim if you haven't set anything). I simply changed the line to credential.helper=manager instead of removing it, as I don't know what the default helper is. Like @Abbreviate said, git renamed credential manger core to credential manager a few years ago . You can find out more here: github.com/git-ecosystem/git-credential-manager/blob/main/docs/…Roccoroch
P
15

So, no one answer helped me. What i did. I removed manually all section [credintial] and [alias] from global and system config. From system config for MINGW64 here: C:\Program Files\Git\mingw64\etc\gitconfig I deleted this section:

[credential]
    helper = manager-core

From global config for MINGW64 here: C:\Users<YourUsersFolder>.gitconfig I deleted this sections:

[alias]
    credential-manager = credential-manager-core
[credential]
    helper = manager-core

And I have no this annoing message any more

Pone answered 29/3, 2023 at 6:37 Comment(2)
This is what worked for me. My repo server is gitlap. I have the following lines on my .gitconfig file: [credential "https://server_address.ipip.com"] provider = genericCerargyrite
Likewise for myself. I had several entries in the [credentials] section, with an incomplete line, and a duplicate. Clearing them out manually solved it.Stansbury
B
8

I also faced this error. how ever I tried more methods and finally below command worked for me. when we replace all config details it will fix. after run below command and then after you can again try git commands like clone, pull, push etc.. then automatically prompt login screen. after login successfully you can work without any issue.

git config --global credential.helper manager-core --replace-all
Butene answered 16/11, 2022 at 15:36 Comment(3)
This works for me. I have permanent error on all actions (fetch, commit, etc) "git-credential-manager-core.exe: no such file or directory". After this command Fetch goes without problemFear
After I did so the annoying message become printing twice :)Pone
I don't think this will work for me since I'm working on a remote (headless) machine where I can't have a login screen open upDemijohn
B
5
> git credential-manager configure

fixed my issue with vscode under windows 10

Boarfish answered 30/4 at 12:41 Comment(0)
B
4

credential.helper is related to credential management which stores user usernames and passwords.To unset this use the below command:

git config --global --unset credential.helper

This will remove the globally configured credential helper.

Birdt answered 21/1 at 7:32 Comment(0)
L
2

You should check what version of git you are running: I ran into the same issue and figured that I was using MSys2's package of Git instead of GitForWindows, while crediential-manager is exclusive to Microsoft's port of Git.

Use where git in your shell to see the actual path used for git.exe:

❯ where git
C:\msys64\usr\bin\git.exe
C:\Program Files\Git\cmd\git.exe

Uninstall the MSys2 package for Git if the first line is pointing to msys64 instead of Program Files (like above):

❯ pacman -R git
checking dependencies...

Packages (1) git-2.41.0-1

Total Removed Size:  35.97 MiB

:: Do you want to remove these packages? [Y/n] Y
:: Processing package changes...
(1/1) removing git

This fixed the credential-manager for me:

❯ where git
C:\Program Files\Git\cmd\git.exe

❯ git credential-manager
Required command was not provided.

git-credential-manager

Usage:
  git-credential-manager [options] [command]

Options:
  --version       Show version information
  -?, -h, --help  Show help and usage information

Commands:
  get          [Git] Return a stored credential
  store        [Git] Store a credential
  erase        [Git] Erase a stored credential
  configure    Configure Git Credential Manager as the Git credential helper
  unconfigure  Unconfigure Git Credential Manager as the Git credential helper
  diagnose     Run diagnostics and gather logs to diagnose problems with Git Credential Manager
  azure-repos  Commands for interacting with the Azure Repos host provider

Note that you can't use GitHub without this credential-manager since August 13, 2021:

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
Lambertson answered 23/7, 2023 at 9:49 Comment(0)
M
2

I edited the .gitconfig file in my user folder and found that it was containing an empty entry in the credential section:

[credential]
    helper = 
    helper = manager-core

I removed

    helper = 

and it fixed my issue.

Mcallister answered 13/12, 2023 at 16:50 Comment(0)
F
0

Curiously, I receive the same error message when trying to push to a branch that had been deleted on the origin side. Instead of git commit, git push works in this situation.

Fudge answered 9/2 at 13:52 Comment(0)
E
0

I read the answers and tinkered with the files - no-one has written the "why" however...

I don't know how it works, I've just been using git as part of Visual Studio with Azure Devops...

I found there are several gitconfig files on my computer, that was the main problem I didn't know where they all were... so I would change one but it wasn't having an effect.

  • C:\Users<myusername>.gitconfig
  • C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\etc\gitconfig
  • C:\Program Files\Git\etc\gitconfig

I opened each of these files and removed the entire [alias] section and the entire [credential] section... this made the errors go away

As far as I can tell the "credential helper" is a feature that is either deprecated, or no longer required due to integration into the main perhaps.

Given no-one has explained what it means or does or why it's there, all I can do is prod at it.

Embarkation answered 24/2 at 23:59 Comment(0)
S
0

modified @Teemo and @Raptor's solutions slightly:

ran git config --global -e

and altered

[credential] helper = manager-core to [credential] helper = helper = manager

fixed my issue on windows 11.

Sliver answered 20/3 at 14:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.