git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Guilherme <guibufolo@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Fwd: git clone does not respect command line options
Date: Sun, 28 Feb 2016 00:01:13 -0500	[thread overview]
Message-ID: <20160228050113.GA19131@sigill.intra.peff.net> (raw)
In-Reply-To: <CAMDzUtxnSeTrfBWWqeOVQm30x5nE6fC9LSx=YNSws2h24TmchQ@mail.gmail.com>

On Sun, Feb 28, 2016 at 09:03:43AM +0530, Guilherme wrote:

> What is the current situation if credential.helper is set twice in the same
> config file.
> 
> Either
> [credential]
>   helper = first
>   helper = second
> 
> or with
> [credential]
>   helper = first
> 
> [credenital]
>   helper = second
> 
> Will both be used by git clone?

Yes, both are used, as documented in gitcredentials(7).

> How do i remove these from the command line?
> I tried git config --unset credential.helper but that only gives you a
> warning and does not remove any.

Try --unset-all.

Also make sure you tell "git config" to operate on the file that
actually contains them. In v2.8.0-rc0 (but not in any released version),
we have --show-origin, and you can do:

  $ git config --show-origin --get-all credential.helper
  file:/home/peff/.gitconfig      cache
  file:.git/config        first
  file:.git/config        second

Write operations work on .git/config by default; if the entries are in
your ~/.gitconfig, use "--global --unset-all".

> Worse is that if second is the empty string there is no way for one to know
> there is a second set unless he tries to delete the first one. But one
> still cannot query the value of the second.

Try --get-all, which will print all values for a key (you can also use
--get-regexp if you want to find other credential.* keys).

-Peff

      parent reply	other threads:[~2016-02-28  5:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMDzUtzoiJWzckTX818HJV=su0eEP35gsNDJ=+k_me08EDvxRg@mail.gmail.com>
2016-02-26  6:47 ` Fwd: git clone does not respect command line options Guilherme
2016-02-26  7:34   ` Jeff King
2016-02-26  7:46     ` Guilherme
2016-02-26  7:59       ` Jeff King
2016-02-26  8:15         ` Jacob Keller
2016-02-26  8:24           ` Jeff King
2016-02-26  8:34             ` Duy Nguyen
2016-02-26  8:45               ` Jeff King
     [not found]             ` <CAMDzUtwG9pLz6CqxVEaw5xcZwQ2Ni37h_R45+frzJrRshgpZQg@mail.gmail.com>
2016-02-26  9:57               ` Jeff King
2016-02-26 16:59     ` Junio C Hamano
2016-02-28  3:37       ` Guilherme
     [not found]       ` <CAMDzUtxnSeTrfBWWqeOVQm30x5nE6fC9LSx=YNSws2h24TmchQ@mail.gmail.com>
2016-02-28  5:01         ` 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=20160228050113.GA19131@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=guibufolo@gmail.com \
    /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).