简体   繁体   中英

Deleting the credentials from Windows Credential Manager still displayed credentials when using git credential fill command

I'm running the latest Git For Windows 2.29.2 , and for me credential.helper is set to manager-core by default. I did confirm that running git config --system --list .

I wanted to implement token based authentication for any of the git operations w.r.t GitHub. So I went ahead and deleted the credentials(which were originally username/password combinations) from the Control-Panel-> Credential manger -> Windows Credential -> Generic Credentials . I then executed the command:

git credential fill
protocol=https
host=github.com`
<HIT ENTER KEY TWICE, as A blank line signals input completion>

To my surprise the above command still returned credentials. I went back to control panel and confirmed if it was deleted and I could not see the credentials, ie they were already deleted.

Why then did the above command successfully return the credentials. As far as I know git caches credentials for 15 minutes that too in memory. However the above command still returned the credentials after few hours. I tried opening fresh prompts, but no luck until today after about a day I happened to notice that the behavior is no more reproduceable.

Now it works as expected, ie if I delete credentials from control panel's credential manager then the git credential fill is not able to return any credentials and instead provides me with a prompt to enter the credentials.

Why did git credential fill return credentials in the first place even if I tried after several hours? I'm just not able to get my head around this behavior.

git config --system list only shows system level config, try git config list --show-origin instead.

You can have multiple credential helpers configured at different levels of config and git will use them in turn if the previous one doesn't return credentials, sounds like you might have another one configured elsewhere

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM