How can I force user and password prompt when pushing to my git repository?

git, github

Solution

With `git config -l`, I now see I have a `credential.helper=osxkeychain` option

That means the credential helper (initially introduced in 1.7.10) is now in effect, and will cache automatically the password for accessing a remote repository over HTTP. (as in "GIT: Any way to set default login credentials?")

You can disable that option entirely, or only for a single repo.

Problem

I recently updated my local Git installation to `1.8.1` from `1.8.0.1`. I'm noticing that, when I work on GitHub, it doesn't prompt me for username and password on push anymore. This troubles me, as I see having to type user and password every time as a good security measure. (what if someone else uses my computer?) I checked the following: - `1.8.0.1` on another computer still asks for username and password. - my account on github still enforces private/security controls. - I am using https remote references, rather than ssh. - For good measure, I checked in my `~/.ssh` fonder. Nothing wrong there. - I'm not storing the login details in `~/.gitconfig` or individual `<proj>/.git/config` files. - I'm also not storing anything github-related in `~/.netrc`. - I created a new dummy archive: still doesn't prompt me for login. I couldn't find anything in the git release notes archive. Does anyone know if this is a new git behaviour? How do I restore the prompt?

Original source

Related problems