threads / discuss / 36400

Clear an invalid password out of the credential-cache?

Subject: Clear an invalid password out of the credential-cache?

## tl;dr

2 messages between Apr 12, 2014 and Apr 14, 2014.

replies: 1people: 2as markdown or json

Jason Pyeron· Apr 12, 2014, 13:12 UTC · lore

Is it me or is the only way to clear a single invalid password out of the credential-cache is by "git credential-cache exit"?

-Jason
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.
Jeff King· Apr 14, 2014, 22:15 UTC · re: Jason Pyeron · lore

Re: Clear an invalid password out of the credential-cache?

On Sat, Apr 12, 2014 at 09:12:57AM -0400, Jason Pyeron wrote:
> Is it me or is the only way to clear a single invalid password out of the
> credential-cache is by "git credential-cache exit"?
Try the "reject" action:
  $ : remember a credential
  $ url() { echo url=https://example.com; }
  $ (url; echo username=me; echo password=foo) | git credential-cache store
  $ : get it again
  $ url | git credential-cache get
  username=me
  password=foo
  $ : forget it
  $ url | git credential-cache erase
  $ : now produces nothing
  $ url | git credential-cache get

Git should do this for you automatically if it tries to use the password and gets rejected (but only if the rejection is a password rejection, like an HTTP 401).

-Peff

← back to recent threads