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

Re: Fwd: Git credentials not working

From
Jeff King <peff@peff.net>
Date
Oct 3, 2018, 17:11 UTC
Message-ID
<20181003171104.GA12200@sigill.intra.peff.net>
In-Reply-To
<f4f7bd2c-4c48-e749-4df1-ddf05896b337@gmail.com>
On Wed, Oct 03, 2018 at 09:06:38PM +0700, Dimitri Kopriwa wrote:
Show 8 quoted lines
> 18:25:52.940307 git.c:659               trace: exec: git-credential-store erase
> 18:25:52.940365 run-command.c:637       trace: run_command: git-credential-store erase
> remote: HTTP Basic: Access denied
> fatal: Authentication failed for
> 'https://git.example.com/example/some-project.git/'
> [...]
> 
> Can you please help me found why is git credential-store erase called ?

This is expected. We tried to use a credential that was rejected by the server, so we told all of the helpers it was invalid. You can try running GIT_TRACE_CURL=1 to see the HTTP conversation. There will be an HTTP 401 with the authentication failure, though it may not tell you anything more useful than that.

git-credential-store is meant to be used interactively, to insert and erase credentials as they're grabbed from the terminal.

It sounds more like you want to just have a stored credential that you try to use. You could do that with a custom helper. E.g., something like this in your ~/.gitconfig:

  [credential "https://example.com"]
  helper = "!f() { test $1 = get && echo password=$(cat /path/with/password); }; f"
-Peff
Previous: Dimitri KopriwaNext: Dimitri Kopriwa
Message 4 of 10 in “Fwd: Git credentials not working”
  1. Dimitri KopriwaOct 3, 2018
  2. Christian CouderOct 3, 2018
  3. Dimitri KopriwaOct 3, 2018
  4. Jeff KingOct 3, 2018
  5. Dimitri KopriwaOct 3, 2018
  6. Jeff KingOct 3, 2018
  7. Dimitri KopriwaOct 3, 2018
  8. Bryan TurnerOct 3, 2018
  9. Jeff KingOct 3, 2018
  10. Dimitri KopriwaOct 3, 2018

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.