git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Fwd: git clone does not respect command line options

From
Jeff King <peff@peff.net>
Date
Feb 28, 2016, 05:01 UTC
Message-ID
<20160228050113.GA19131@sigill.intra.peff.net>
In-Reply-To
<CAMDzUtxnSeTrfBWWqeOVQm30x5nE6fC9LSx=YNSws2h24TmchQ@mail.gmail.com>
On Sun, Feb 28, 2016 at 09:03:43AM +0530, Guilherme wrote:
Show 16 quoted lines
> 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
Previous: Jeff King
Message 12 of 12 in “Fwd: git clone does not respect command line options”
  1. GuilhermeFeb 26, 2016
  2. Jeff KingFeb 26, 2016
  3. GuilhermeFeb 26, 2016
  4. Jeff KingFeb 26, 2016
  5. Jacob KellerFeb 26, 2016
  6. Jeff KingFeb 26, 2016
  7. Duy NguyenFeb 26, 2016
  8. Jeff KingFeb 26, 2016
  9. Junio C HamanoFeb 26, 2016
  10. GuilhermeFeb 28, 2016
  11. Jeff KingFeb 26, 2016
  12. Jeff KingFeb 28, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.