git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jason Pyeron <jpyeron@pdinc.us>
Cc: 'Git List' <git@vger.kernel.org>
Subject: Re: Clear an invalid password out of the credential-cache?
Date: Mon, 14 Apr 2014 18:15:30 -0400	[thread overview]
Message-ID: <20140414221530.GA29704@sigill.intra.peff.net> (raw)
In-Reply-To: <2D1883E9414E4E1E99559A6A2163BE87@black>

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

      reply	other threads:[~2014-04-14 22:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-12 13:12 Clear an invalid password out of the credential-cache? Jason Pyeron
2014-04-14 22:15 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140414221530.GA29704@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jpyeron@pdinc.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).