-1

When I try to fetch something with git from command line I get:

"git: 'credential-git' is not a git command. See 'git --help'.
remote: Invalid username or password."

Any idea where credential-git is stored? Sourcetree and other clients are also not working.

Here is my git config:

credential.helper=osxkeychain
user.name=My Name
user.email=my@email.com
core.excludesfile=/Users/oge/.gitignore_global
difftool.sourcetree.cmd=opendiff "$LOCAL" "$REMOTE"
difftool.sourcetree.path=
mergetool.sourcetree.cmd=/Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
mergetool.sourcetree.trustexitcode=true
commit.template=/Users/myuser/.stCommitMsg
url.https://api:@github.com/.insteadof=https://github.com/
url.https://ssh:@github.com/.insteadof=ssh://git@github.com/
url.https://git:@github.com/.insteadof=git@github.com:
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.https://dev.azure.com.usehttppath=true
credential.helper=manager-core
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
netshark1000
  • 7,245
  • 9
  • 59
  • 116
  • 3
    You've configured `credential.helper` to `git`, but you don't have a `credential-git`. Why did you configure `credential.helper` to `git` in the first place? – torek Oct 16 '20 at 14:31

1 Answers1

1

As illustrated in this question, the credential helper should be set, for MacOS, to osxkeychain

git config --global credential.helper osxkeychain

You can then use it as described by GitHub in "Updating credentials from the macOS Keychain".

As mentioned by torek, any credential helper value would incite Git to execute the executable git-credential-xxx. For a Mac Git distribution, that would be git-credential-osxkeychain.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • set the credential helper, password in keychain is correct, but I still get authentication error. Where Do I set my access token? – netshark1000 Oct 19 '20 at 18:53
  • @netshark1000 That cn happen if you are not using an HTTPS URL but an SSH one. Or you are using an HTTPS URL, but with a password instead of a personal access token. (https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token – VonC Oct 19 '20 at 18:55
  • I replaced all GitHub entries in keychain with the token. (The repo is fetched via https). But still the same. With GitHub desktop it asks for credentials but also fails with password or token. I have no problem on another Mac. – netshark1000 Oct 20 '20 at 06:56
  • @netshark1000 Can you check if updating Git and using the Credential Manager Core (`git config --global credential.helper manager-core`) helps? https://github.com/microsoft/Git-Credential-Manager-Core#download-and-install – VonC Oct 20 '20 at 10:21
  • Now I get git: 'credential-manager-core' is not a git command. See 'git --help'. when trying to clone – netshark1000 Oct 20 '20 at 12:21
  • @netshark1000 Yes, that is why I pointed to https://github.com/microsoft/Git-Credential-Manager-Core#download-and-install, the "Download and Install" section. – VonC Oct 20 '20 at 12:21
  • I installed the MS tool, executed git config --global credential.helper manager-core (had two entries for credential.helper first) and also removed all credentials from keychain. Restarted my Mac. But I still get authentication error. git is not asking for credentials - they seem to be cache somewhere. In my post you can see my config now. – netshark1000 Oct 21 '20 at 07:01
  • @netshark1000 what does `git remote -v` return? (when executed from your repo folder) Maybe you are using a `git@xxx` URL, which would be a SSH URL: that would not involve any credential helper (reserved for caching credentials for HTTPS URL) – VonC Oct 21 '20 at 08:43