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

Re: Git credentials not working

From
Dimitri Kopriwa <d.kopriwa@gmail.com>
Date
Oct 3, 2018, 17:29 UTC
Message-ID
<d4f5551f-89d2-d63e-49da-dd80f22ea9ce@gmail.com>
In-Reply-To
<CAP8UFD3LEYd7RytZU_-wVcDosH+6VSdM2j3NUcnR0aQc8QfoQg@mail.gmail.com>
On 10/3/18 11:03 PM, Christian Couder wrote:
Show 13 quoted lines
> (removing git-security from CC)
>
> On Wed, Oct 3, 2018 at 4:09 PM Dimitri Kopriwa <d.kopriwa@gmail.com> wrote:
>
>> Git credentials in ~/.git-credentials and ~/.config/git/credentials are
>> being removed by git upon reading.
> https://git-scm.com/docs/git-credential says:
>
> "If the action is reject, git-credential will send the description to
> any configured credential helpers, which may erase any stored
> credential matching the description."
>
> So maybe this is expected.

I am using this script to create my credential file, how am I supposed to do in a non tty environment? Is there a prefered way?

Show 14 quoted lines
>
> Another possibility is that your .gitlab-ci.yml might launch scripts
> writing into those files, like the before_script.sh script that is
> described on:
>
> https://stackoverflow.com/questions/50553049/is-it-possible-to-do-a-git-push-within-a-gitlab-ci-without-ssh
>
> Could you also check which credential helper and which options are
> used? For example with commands like:
>
> $ git config -l --show-origin | grep -i cred
> $ git config -l --show-origin | grep -i http
> $ git config -l --show-origin | grep -i askpass
> $ env | grep -i askpass
  * branch            HEAD       -> FETCH_HEAD
17:15:36.175966 run-command.c:637       trace: run_command: git gc --auto
17:15:36.177688 git.c:415               trace: built-in: git gc --auto
$ git config -l --show-origin | grep -i cred
17:15:36.180191 git.c:415               trace: built-in: git config -l 
--show-origin
file:/root/.gitconfig    credential.helper=store
file:.git/config    credential.helper=store
$ git config -l --show-origin | grep -i http
17:15:36.182768 git.c:415               trace: built-in: git config -l 
--show-origin
file:.git/config 
remote.origin.url=https://git.example.com/example/sample-project.git
$ git config -l --show-origin | grep -i askpass || echo nothing 
to do
17:15:36.185306 git.c:415               trace: built-in: git config -l 
--show-origin
nothing to do
$ env | grep -i askpass || echo nothing to do
nothing to do
Previous: Christian CouderNext: Jeff King
Message 3 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.