How to get git to request credentials?

A few weeks ago (and in fog) I needed to make some changes to something posted on github. I was sent by someone-who-knows-more-than-me (SWKMTM) over the phone, exactly what to enter, to set up, pull out, change, push, and then activate everything. Part of this was to issue git instructions that said I was like SWKMTM.

Now that I learned a little about git / github (and also remembered my github login information), I returned and tried to replace my identity with SWKMTM on my client machine (a la git config --global user.name and git config --global user.email ). After that, I can perform the same actions as before. However, I will still need to enter the github password (i.e. there is no prompt to enter my github password). I assume that something was cached, identifying me as SWKMTM (and that I had to do something in an earlier fog that included entering the SWKMTM github password) - either locally or by implicitly sending my SSH public key.

I searched in vain for. * rc files and configuration directories for everything that resembles credentials that might be associated with SWKMTM (in the hope of sending the specified credentials and forcing git to request new ones). I also did not find anything on github that could tell if there are any aliases for public keys (and how this can be cleared).

I also tried the recommended "git config -l" for any credential assistant and did not find anyone.

How to make github forget that I disguised as SWKMTM?

[sidenote: this is on MacOS without specifying in configuration files that use the -ssxkeychain account. Only after using GIT_TRACE=1 when clicked it was obvious where the account is stored.]

+4
source share
1 answer

user.name and user.email have nothing to do with credentials, it's just strings that fit into every commit you make to store your attribution information.

Git usually authenticates you through SSH, so you need to either copy your SSH private key from another computer to a new client, or create a new key pair and add the public part to your github profile.


OK, after extensive discussion in the chat, it turns out that Git used the osxkeychain helper assistant, which provided the previously saved credentials.

Delete the stored credentials from your OSX keychain or disable the helper helper ( credential.helper config parameter) in Git to request authentication again.

+4
source

All Articles