Git credential fill rejects my input, scheduled on Windows Git credential fill rejects my input, scheduled on Windows git git

Git credential fill rejects my input, scheduled on Windows


First, a disclaimer: I don't know the plumbing of Git, and I'm just hacking things together to make them work and commenting it here in case it is helpful to you. I'm also using an out-of-date version of Git at this point (1.9.5.mysysgit; I have reasons).

My experience from trying to do something similar has been that git-credential was difficult to get working correctly. I did, however, get something similar to work by operating using the credential helper more directly.

I found an article about the credentials API that describes calling git credential-foo when git config credential.helper returns foo. This seems to have a slightly different interface, with the command get instead of fill (which also seems much more logical).

In any case, for me, my credential helper is wincred, and let's call the host mysite.com. I do most of my work using the same site, so the Windows credential manager shows a saved credential for https://myusername@mysite.com, rather than to any specific path. Calling it, I enter:

>git credential-wincred getprotocol=httpshost=mysite.com

and then get out:

username=myusernamepassword=mypassword

I can also add a username to the input list, and it outputs the same thing. If I add any path to the inputs, or replace the host with the IP address, it doesn't work.

My suggestion would be to see if you can use the git credential-foo <get|store|erase> syntax rather than git credential <fill|approve|reject>, though they appear to be in essence the same thing, just with slightly different names.


To answer your more specific questions:

What did I do wrong?

Assuming I understand correctly that you're trying to set the Git credentials, I think you want to call git credential approve rather than git credential fill, as approve will actually send your entered values to the helper for storage, whereas fill is attempting to fill in holes in the data you provided (I think; the naming here and elsewhere is confusing in Git).

What is the correct path to provide?

I'm not sure, as my one overlapping usage didn't have a path, but I'd suggest srv/gitosis/repositories/Matlab.git, as the leading slash is implied by this being the path.

What is the host name?

I suspect what's going on here is simple string matching on the host in your remote name, rather than a lookup of the domain, so I'd suggest using host=10.10.10.102 for your situation.


The easiest way is to use Git Bash to type in your commands, instead of using the Command Prompt. This will solve the stdin problem.


I found that it was an issue with line endings in the Windows command shell. Holding the Alt key, then press 1 and 0 on the numeric keypad (in other words inserting a Line Feed character), followed by pressing Enter on the keyboard got it working for me.