8

If I execute git credential-osxkeychain get, it just hangs when it should return information regarding what credentials are stored in the keychain. Is there a way to make this work?

I am using OS X 10.15.5

$ git credential-osxkeychain
usage: git credential-osxkeychain <get|store|erase>

$ git --version
git version 2.27.0
0

2 Answers 2

10

All of git credential-* helpers are meant to be used internally by git itself and follow a specific interface.

When the helper is run with the get subcommand, it waits for input on stdin and expects to read a series of "key=value" lines. For example, host=github.com. This is how git tells the helper which credentials are needed.

When you run a program directly in a terminal, its stdin is just connected to keyboard input. After the first Enter keypress, the tool is already running but waiting for keyboard input, exactly like tools such as cat or sed would.

After the second keypress, the program reads an empty line and treats it as an "end of input" indicator, i.e. that no more key=value lines will be entered. At this point it searches the keychain and finds whichever entry it thinks matches your "provided" filter.

1

This worked for me : Deleting your credentials via the command line

$ git credential-osxkeychain erase
host=github.com
protocol=https
> [Press Return]

If it's successful, nothing will print out. To test that it works, try and clone a private repository from GitHub.com. If you are prompted for a password, the keychain entry was deleted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .