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

[ISSUE] `git push` keep asking for username when the global config already configured (wincred)

From
AAndry <andry@inbox.ru>
Date
Dec 21, 2023, 16:16 UTC
Message-ID
<1585479613.20231221201604@inbox.ru>
Hello Git,

Accidentally have found the issue when the Git is properly installed (git-scm.com) and configured over the global config under Window 8. Btu if try to use the Cygwin (cygwin.com) installation for the Bash interpreter like this from the `myscript.bat`:

myscript.bat -> myscript.sh -> `git push ...`
Then the git asks for the username.
If directly run the command `git push ...`, then it works as expected without the username prompt.
The issue is around the HOME variable behind the Cygwin installation, when the Git thinks the configuration is in the Cygwin, instead of in the Windows users folder.
The workaround can be something like this:
```bash
  # WORKAROUND:
  #   The `git push` asks for username under the bash shell call from the Windows cmd.exe script.
  #
  [[ -n "${COMSPEC+x}" ]] && unset HOME
```
>git --version
git version 2.43.0.windows.1
>winver
Version 6.2 (Build 9200)
Message 1 of 1 in “[ISSUE] `git push` keep asking for username when the global config already configured (wincred)”
  1. AndryDec 21, 2023

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.