2

Environment Definition:

  • Using windows 10 operating system:
  • I use both git from https://git-scm.com/ and Github's Git Shell

Background:

When I issue a got clone command like below:

git clone https://UserName@Url.com:443/name.git

Git prompts me for the password for the 1st time. Then it stores or caches is somewhere.

Question:

Where is the password stored or cached in Windows? Is there any git command that lists the cached/stored credentials for all repositories?

More clarification request:

Does this depend on the git implementation? The reason I am asking is below two points:

  • It seems that when I use original git from https://git-scm.com/, it stores the passwords in windows password vault. I can see some of the git usernames and passwords there
  • However, I cannot find passwords cached/stored by Github's "Git shell" anywhere

Update 1 based on @milouk response:

In a windows environment, I tried Github's "Git shell" and cloned a repository. It did not ask for any password, so I assume it uses a cached password. , I tried below command and it does not return anything.

git config --global credential.helper wincred

Is this because Github's "Git shell" is not a standard git client?

Update 2 based on @milouk response:

I understand that the password might have been cached in memory.

  • Is there any way to get a list of credentials cached in memory?
  • Is there any way to clean the credentials cached in memory, so i don't have to restart to make sure I am entering the updated password?
Allan Xu
  • 7,998
  • 11
  • 51
  • 122

1 Answers1

4

The reason git prompts you for a username and password is because you're using the HTTPS clone URL for your repository.

The best way to avoid this prompt is to type (if you are using Windows) :

git config --global credential.helper wincred

on your command line.

Or if you are using Linux type :

git config --global credential.helper cache

To Set git to use the credential memory cache

and

git config --global credential.helper 'cache --timeout=3600'

To Set the cache to timeout after 1 hour (setting is in seconds).

To answer your question credentials are cached to memory. So even with the above commands when you reboot you Computer you will have to enter again your credentials.

You can also take a look here for a more detailed explanation.

milouk
  • 171
  • 1
  • 3
  • 11
  • Thank you for help. Please see the Update in my post – Allan Xu Apr 25 '17 at 18:47
  • it should not return something. As they say in Linux "No news = good news". Also it did not required a password and username because you probably cached it it memory. If you reboot your system it should require it again. – milouk Apr 25 '17 at 18:57
  • i am not sure how to list them . You cant try `cmdkey /list` in the command line. you can also refer here http://m.windowsitpro.com/windows/list-cached-credentials-windows – milouk Apr 26 '17 at 08:40