git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [ISSUE] `git push` keep asking for username when the global config already configured (wincred)
@ 2023-12-21 16:16 Andry
  0 siblings, 0 replies; only message in thread
From: Andry @ 2023-12-21 16:16 UTC (permalink / raw)
  To: Git

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-21 17:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21 16:16 [ISSUE] `git push` keep asking for username when the global config already configured (wincred) Andry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).