Home > OS >  git push error after installing libsecret credential helper: 'credential--h' is not a git
git push error after installing libsecret credential helper: 'credential--h' is not a git

Time:09-22

I installed the libsecret credential helper as per the instructions here: https://www.softwaredeveloper.blog/git-credential-storage-libsecret

Now when I push, I get the error git: 'credential --h' is not a git command. See 'git --help', even though the push happens successfully. Why?

Output of git config -l --show-origin | grep credential:

file:/home/alex/.gitconfig  credential.helper=/usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
file:.git/config    credential.helper=-h

CodePudding user response:

The problem is that you have an incorrect entry in .git/config. It's likely that this was just a typo, which is actually not uncommon. When you specify a credential helper as a single word, Git prepends git credential- to it, resulting in the message you saw.

To fix it, just edit the .git/config file with your preferred editor and remove the incorrect entry.

The reason it continues to work is because Git uses each credential helper in order to query and then either approve or reject the credentials. As a result, your functional libsecret credential helper is invoked nonetheless, which provides the credentials you need, and the broken entry is just invoked to approve those credentials, causing the error you saw.

  • Related