Mac:git坏了-凭据问题



当我试图从命令行获取git时,我得到:

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

知道凭证git存储在哪里吗?Sourcetree和其他客户端也不起作用。

这是我的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

如本问题所示,对于MacOS,凭证助手应设置为osxkeychain

git config --global credential.helper osxkeychain

然后,您可以按照GitHub在";从macOS密钥链更新凭证";。

正如torek所提到的,任何凭证助手值都会促使Git执行可执行的git-credential-xxx。对于Mac Git发行版,这将是git-credential-osxkeychain

最新更新