{"thread":{"id":"57199","subject":"Problem with credential.helper=store in git 2.32.0.windows.2","startedAt":"2022-01-06T12:54:18Z","lastAt":"2022-01-10T14:03:55Z","messageCount":5,"participants":["Imi Admin","Johannes Schindelin","Sebastian Richter"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"445623","messageId":"8838ac786ed46b841e4172824b80564b@htw-berlin.de","threadId":"57199","inReplyTo":null,"subject":"Problem with credential.helper=store in git 2.32.0.windows.2","fromName":"Imi Admin","fromEmail":"imiadmin@htw-berlin.de","sentAt":"2022-01-06T12:32:03Z","receivedAt":"2022-01-06T12:54:18Z","isPatch":false,"sender":{"key":"imiadmin@htw-berlin.de","avatar":null},"body":"Hi all,\n\ni've filled out the bug report below, maybe you can help me...\n\nBest Sebastian\n\n*****************************************************************************\n\nThank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\nI sometimes have to use git commands on a remote Windows10 through a ssh \nshell (PowerShell Server, so powershell as the shell). I'm creating a \ncredentials store file for these commands and set the local git \nconfiguration credential.helper=store to point to this file.\nHere's my local git configuration:\n\nPS C:\\scripts> git config -l --show-origin\nfile:C:/Program \nFiles/Git/etc/gitconfig\tdiff.astextplain.textconv=astextplain\nfile:C:/Program Files/Git/etc/gitconfig\tfilter.lfs.clean=git-lfs clean \n-- %f\nfile:C:/Program Files/Git/etc/gitconfig\tfilter.lfs.smudge=git-lfs smudge \n-- %f\nfile:C:/Program Files/Git/etc/gitconfig\tfilter.lfs.process=git-lfs \nfilter-process\nfile:C:/Program Files/Git/etc/gitconfig\tfilter.lfs.required=true\nfile:C:/Program Files/Git/etc/gitconfig\thttp.sslbackend=openssl\nfile:C:/Program Files/Git/etc/gitconfig\thttp.sslcainfo=C:/Program \nFiles/Git/mingw64/ssl/certs/ca-bundle.crt\nfile:C:/Program Files/Git/etc/gitconfig\tcore.autocrlf=true\nfile:C:/Program Files/Git/etc/gitconfig\tcore.fscache=true\nfile:C:/Program Files/Git/etc/gitconfig\tcore.symlinks=false\nfile:C:/Program Files/Git/etc/gitconfig\tcore.editor=\"C:\\\\Program \nFiles\\\\Notepad++\\\\notepad++.exe\" -multiInst -notabbar -nosession \n-noPlugin\nfile:C:/Program Files/Git/etc/gitconfig\tpull.rebase=false\nfile:C:/Program Files/Git/etc/gitconfig\tcredential.helper=manager-core\nfile:C:/Program \nFiles/Git/etc/gitconfig\tcredential.https://dev.azure.com.usehttppath=true\nfile:C:/Program Files/Git/etc/gitconfig\tinit.defaultbranch=master\nfile:.git/config\tcore.repositoryformatversion=0\nfile:.git/config\tcore.filemode=false\nfile:.git/config\tcore.bare=false\nfile:.git/config\tcore.logallrefupdates=true\nfile:.git/config\tcore.symlinks=false\nfile:.git/config\tcore.ignorecase=true\nfile:.git/config\tremote.origin.url=https://mygitlab.de/mygroup/myrepo.git\nfile:.git/config\tremote.origin.fetch=+refs/heads/*:refs/remotes/origin/*\nfile:.git/config\tbranch.master.remote=origin\nfile:.git/config\tbranch.master.merge=refs/heads/master\nfile:.git/config\tuser.name=myname\nfile:.git/config\tuser.email=my@email\nfile:.git/config\tcredential.helper=store --file \nC:/scripts/.git/.git-credentials\n\nWhat did you expect to happen? (Expected behavior)\n\nI'd expect that a 'git pull' against my remote simply works without \nasking me for a user name and password.\n\nWhat happened instead? (Actual behavior)\n\nMy ssh connection hangs...\n\nWhat's different between what you expected and what actually happened?\n\nPlease see above and below...\n\nAnything else you want to add:\n\nMy approach worked in a prior git for windows version.\nWhen i use the same approach on the same remote Windows 10 client via \nRDP in Powershell, i see that *before* git uses the credential store \nfile, it displays the windows credential dialog. If i click 'cancel' in \nthe dialog, git uses the credential store file:\n\nPS C:\\scripts> git pull\n09:33:11.471005 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/bin\n09:33:11.471005 git.c:455               trace: built-in: git pull\n09:33:11.471005 run-command.c:667       trace: run_command: git fetch \n--update-head-ok\n09:33:11.486629 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:11.502137 git.c:455               trace: built-in: git fetch \n--update-head-ok\n09:33:11.502137 run-command.c:667       trace: run_command: GIT_DIR=.git \ngit remote-https origin https://mygitlab.de/mygroup/myrepo.git\n09:33:11.517762 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:11.517762 git.c:744               trace: exec: git-remote-https \norigin https://mygitlab.de/mygroup/myrepo.git\n09:33:11.517762 run-command.c:667       trace: run_command: \ngit-remote-https origin https://mygitlab.de/mygroup/myrepo.git\n09:33:11.611382 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:11.720731 run-command.c:667       trace: run_command: 'git \ncredential-manager-core get'\n09:33:11.783217 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:11.798838 git.c:744               trace: exec: \ngit-credential-manager-core get\n09:33:11.798838 run-command.c:667       trace: run_command: \ngit-credential-manager-core get\nfatal: User cancelled the authentication prompt.\n09:33:22.955081 run-command.c:667       trace: run_command: 'git \ncredential-store --file C:/scripts/.git/.git-credentials get'\n09:33:22.970702 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:22.970702 git.c:455               trace: built-in: git \ncredential-store --file C:/scripts/.git/.git-credentials get\n09:33:23.174185 run-command.c:667       trace: run_command: 'git \ncredential-manager-core store'\n09:33:23.236463 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:23.236463 git.c:744               trace: exec: \ngit-credential-manager-core store\n09:33:23.236463 run-command.c:667       trace: run_command: \ngit-credential-manager-core store\n09:33:23.689909 run-command.c:667       trace: run_command: 'git \ncredential-store --file C:/scripts/.git/.git-credentials store'\n09:33:23.705534 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:23.705534 git.c:455               trace: built-in: git \ncredential-store --file C:/scripts/.git/.git-credentials store\n09:33:23.892547 run-command.c:667       trace: run_command: git rev-list \n--objects --stdin --not --all --quiet --alternate-refs\n09:33:23.924306 run-command.c:667       trace: run_command: git rev-list \n--objects --stdin --not --all --quiet --alternate-refs\n09:33:23.924306 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:23.924306 git.c:455               trace: built-in: git rev-list \n--objects --stdin --not --all --quiet --alternate-refs\n09:33:23.939814 run-command.c:1628      run_processes_parallel: \npreparing to run up to 1 tasks\n09:33:23.939814 run-command.c:1660      run_processes_parallel: done\n09:33:23.939814 run-command.c:667       trace: run_command: git \nmaintenance run --auto --no-quiet\n09:33:23.939814 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:23.939814 git.c:455               trace: built-in: git maintenance \nrun --auto --no-quiet\n09:33:23.939814 run-command.c:667       trace: run_command: git merge \nFETCH_HEAD\n09:33:23.955440 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n09:33:23.955440 git.c:455               trace: built-in: git merge \nFETCH_HEAD\nAlready up to date.\n\nThe same happens when i try this with the ssh connection, but the \ncommand hangs when trying to exec git-credential-manager-core get:\n\nPS C:\\scripts> git pull\n10:02:33.240054 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/bin\n10:02:33.240054 git.c:455               trace: built-in: git pull\n10:02:33.240054 run-command.c:667       trace: run_command: git fetch \n--update-head-ok\n10:02:33.255676 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n10:02:33.255676 git.c:455               trace: built-in: git fetch \n--update-head-ok\n10:02:33.255676 run-command.c:667       trace: run_command: GIT_DIR=.git \ngit remote-https origin \nhttps://imiadmgit.f4.htw-berlin.de/f4-imi-li/windows-scripts.git\n10:02:33.255676 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n10:02:33.255676 git.c:744               trace: exec: git-remote-https \norigin https://imiadmgit.f4.htw-berlin.de/f4-imi-li/windows-scripts.git\n10:02:33.255676 run-command.c:667       trace: run_command: \ngit-remote-https origin \nhttps://imiadmgit.f4.htw-berlin.de/f4-imi-li/windows-scripts.git\n10:02:33.271297 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n10:02:33.380647 run-command.c:667       trace: run_command: 'git \ncredential-manager-core get'\n10:02:33.396268 exec-cmd.c:237          trace: resolved executable dir: \nC:/Program Files/Git/mingw64/libexec/git-core\n10:02:33.396268 git.c:744               trace: exec: \ngit-credential-manager-core get\n10:02:33.396268 run-command.c:667       trace: run_command: \ngit-credential-manager-core get\n\nAnyway as far as i understood git should not exec \ngit-credential-manager-core get at all with my local git configuration?\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.32.0.windows.2\ncpu: x86_64\nbuilt from commit: 3d45ac813c4adf97fe3733c1f763ab6617d5add5\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Windows 10.0 19043\ncompiler info: gnuc: 10.3\nlibc info: no libc information available\n$SHELL (typically, interactive shell): <unset>\n\n\n[Enabled Hooks]\n\n*****************************************************************************\n\n\n\n-- \nThanks, Sebastian\n"},{"id":"445816","messageId":"nycvar.QRO.7.76.6.2201092246520.339@tvgsbejvaqbjf.bet","threadId":"57199","inReplyTo":"8838ac786ed46b841e4172824b80564b@htw-berlin.de","subject":"Re: Problem with credential.helper=store in git 2.32.0.windows.2","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-01-09T21:53:17Z","receivedAt":"2022-01-09T21:53:26Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Sebastian,\n\nOn Thu, 6 Jan 2022, Imi Admin wrote:\n\n> Here's my local git configuration:\n>\n> PS C:\\scripts> git config -l --show-origin\n> [...]\n> file:C:/Program Files/Git/etc/gitconfig\tcredential.helper=manager-core\n> file:C:/Program Files/Git/etc/gitconfig\tcredential.https://dev.azure.com.usehttppath=true\n> file:C:/Program Files/Git/etc/gitconfig\tinit.defaultbranch=master\n> file:.git/config\tcore.repositoryformatversion=0\n> file:.git/config\tcore.filemode=false\n> file:.git/config\tcore.bare=false\n> file:.git/config\tcore.logallrefupdates=true\n> file:.git/config\tcore.symlinks=false\n> file:.git/config\tcore.ignorecase=true\n> file:.git/config\tremote.origin.url=https://mygitlab.de/mygroup/myrepo.git\n> file:.git/config\tremote.origin.fetch=+refs/heads/*:refs/remotes/origin/*\n> file:.git/config\tbranch.master.remote=origin\n> file:.git/config\tbranch.master.merge=refs/heads/master\n> file:.git/config\tuser.name=myname\n> file:.git/config\tuser.email=my@email\n> file:.git/config\tcredential.helper=store --file C:/scripts/.git/.git-credentials\n>\n> [...]\n>\n> Anyway as far as i understood git should not exec git-credential-manager-core\n> get at all with my local git configuration?\n\nYou need one additional thing to make that happen. As per\nhttps://git-scm.com/docs/git-config#Documentation/git-config.txt-credentialhelper:\n\n\tNote that multiple helpers may be defined. See gitcredentials[7]\n\tfor details and examples.\n\nAnd in https://git-scm.com/docs/gitcredentials#_configuration_options, we\nread:\n\n\tIf there are multiple instances of the credential.helper\n\tconfiguration variable, each helper will be tried in turn, and may\n\tprovide a username, password, or nothing. Once Git has acquired\n\tboth a username and a password, no more helpers will be tried.\n\n\tIf credential.helper is configured to the empty string, this\n\tresets the helper list to empty (so you may override a helper set\n\tby a lower-priority config file by configuring the empty-string\n\thelper, followed by whatever set of helpers you would like).\n\nSo you need to insert a line \"helper =` (with an empty value) in your\n.git/config's `[credential]` section:\n\n\t[credential]\n\t\t# reset 'credential.helper' list\n\t\thelper =\n\t\thelper = \"store --file C:/scripts/.git/.git-credentials\"\n\nCiao,\nJohannes\n"},{"id":"445818","messageId":"1c331bdd51b424022bfd598c71d7d666@HTW-Berlin.de","threadId":"57199","inReplyTo":"nycvar.QRO.7.76.6.2201092246520.339@tvgsbejvaqbjf.bet","subject":"Re: Problem with credential.helper=store in git 2.32.0.windows.2","fromName":"Sebastian Richter","fromEmail":"sebastian.richter@htw-berlin.de","sentAt":"2022-01-10T07:58:45Z","receivedAt":"2022-01-10T08:24:29Z","isPatch":false,"sender":{"key":"sebastian.richter@htw-berlin.de","avatar":null},"body":"Hi Johannes,\n\nthanks for clarifying this. I'm using 'git config --system --unset \ncredential.helper' before setting the file store in the local \nconfiguration now and it works.\n\nBest Sebastian\n\nAm 09.01.2022 22:53, schrieb Johannes Schindelin:\n> Hi Sebastian,\n> \n> On Thu, 6 Jan 2022, Imi Admin wrote:\n> \n>> Here's my local git configuration:\n>> \n>> PS C:\\scripts> git config -l --show-origin\n>> [...]\n>> file:C:/Program Files/Git/etc/gitconfig\tcredential.helper=manager-core\n>> file:C:/Program \n>> Files/Git/etc/gitconfig\tcredential.https://dev.azure.com.usehttppath=true\n>> file:C:/Program Files/Git/etc/gitconfig\tinit.defaultbranch=master\n>> file:.git/config\tcore.repositoryformatversion=0\n>> file:.git/config\tcore.filemode=false\n>> file:.git/config\tcore.bare=false\n>> file:.git/config\tcore.logallrefupdates=true\n>> file:.git/config\tcore.symlinks=false\n>> file:.git/config\tcore.ignorecase=true\n>> file:.git/config\tremote.origin.url=https://mygitlab.de/mygroup/myrepo.git\n>> file:.git/config\tremote.origin.fetch=+refs/heads/*:refs/remotes/origin/*\n>> file:.git/config\tbranch.master.remote=origin\n>> file:.git/config\tbranch.master.merge=refs/heads/master\n>> file:.git/config\tuser.name=myname\n>> file:.git/config\tuser.email=my@email\n>> file:.git/config\tcredential.helper=store --file \n>> C:/scripts/.git/.git-credentials\n>> \n>> [...]\n>> \n>> Anyway as far as i understood git should not exec \n>> git-credential-manager-core\n>> get at all with my local git configuration?\n> \n> You need one additional thing to make that happen. As per\n> https://git-scm.com/docs/git-config#Documentation/git-config.txt-credentialhelper:\n> \n> \tNote that multiple helpers may be defined. See gitcredentials[7]\n> \tfor details and examples.\n> \n> And in https://git-scm.com/docs/gitcredentials#_configuration_options, \n> we\n> read:\n> \n> \tIf there are multiple instances of the credential.helper\n> \tconfiguration variable, each helper will be tried in turn, and may\n> \tprovide a username, password, or nothing. Once Git has acquired\n> \tboth a username and a password, no more helpers will be tried.\n> \n> \tIf credential.helper is configured to the empty string, this\n> \tresets the helper list to empty (so you may override a helper set\n> \tby a lower-priority config file by configuring the empty-string\n> \thelper, followed by whatever set of helpers you would like).\n> \n> So you need to insert a line \"helper =` (with an empty value) in your\n> .git/config's `[credential]` section:\n> \n> \t[credential]\n> \t\t# reset 'credential.helper' list\n> \t\thelper =\n> \t\thelper = \"store --file C:/scripts/.git/.git-credentials\"\n> \n> Ciao,\n> Johannes\n\n-- \nHochschule für Technik und Wirtschaft\nWilhelminenhofstr. 75A\n12459 Berlin\nGebäude C Raum 538\ntel 030 5019 2945\nfax 030 5019 48 2945\nmail richter@htw-berlin.de\n\n"},{"id":"445824","messageId":"nycvar.QRO.7.76.6.2201101349550.339@tvgsbejvaqbjf.bet","threadId":"57199","inReplyTo":"1c331bdd51b424022bfd598c71d7d666@HTW-Berlin.de","subject":"Re: Problem with credential.helper=store in git 2.32.0.windows.2","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2022-01-10T12:52:56Z","receivedAt":"2022-01-10T12:53:00Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Sebastian,\n\nOn Mon, 10 Jan 2022, Sebastian Richter wrote:\n\n> thanks for clarifying this. I'm using 'git config --system --unset\n> credential.helper' before setting the file store in the local configuration\n> now and it works.\n\nI am not quite sure whether that is a good solution. You are changing the\nsystem configuration for the benefit of a local configuration. That would\npotentially break every other user outside of that repository that now\nworks.\n\nMy suggestion is to either go with my earlier recommendation and add an\nempty `credential.helper` in the repository's config before the actual one\n(and leave the system config alone), or alternatively change the system\nconfig instead of the repository config in the first place.\n\nCiao,\nJohannes\n"},{"id":"445830","messageId":"c0d6f26a5e96f12719d5bfa969529ec9@HTW-Berlin.de","threadId":"57199","inReplyTo":"nycvar.QRO.7.76.6.2201101349550.339@tvgsbejvaqbjf.bet","subject":"Re: Problem with credential.helper=store in git 2.32.0.windows.2","fromName":"Sebastian Richter","fromEmail":"sebastian.richter@htw-berlin.de","sentAt":"2022-01-10T14:03:51Z","receivedAt":"2022-01-10T14:03:55Z","isPatch":false,"sender":{"key":"sebastian.richter@htw-berlin.de","avatar":null},"body":"Hi Johannes,\n\nyou are right, but during my (cluster) ssh connections no one else uses \nmy systems (hopefully), and i do restore the system file afterwards.\n\nBut i'll implement your approach in the next script version.\n\nThanks & best Sebastian\n\nAm 10.01.2022 13:52, schrieb Johannes Schindelin:\n> Hi Sebastian,\n> \n> On Mon, 10 Jan 2022, Sebastian Richter wrote:\n> \n>> thanks for clarifying this. I'm using 'git config --system --unset\n>> credential.helper' before setting the file store in the local \n>> configuration\n>> now and it works.\n> \n> I am not quite sure whether that is a good solution. You are changing \n> the\n> system configuration for the benefit of a local configuration. That \n> would\n> potentially break every other user outside of that repository that now\n> works.\n> \n> My suggestion is to either go with my earlier recommendation and add an\n> empty `credential.helper` in the repository's config before the actual \n> one\n> (and leave the system config alone), or alternatively change the system\n> config instead of the repository config in the first place.\n> \n> Ciao,\n> Johannes\n\n-- \nHochschule für Technik und Wirtschaft\nWilhelminenhofstr. 75A\n12459 Berlin\nGebäude C Raum 538\ntel 030 5019 2945\nfax 030 5019 48 2945\nmail richter@htw-berlin.de\n\n"}]}