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

Re: disable interactive prompting

From
EAErnesto Alfonso <erjoalgo@gmail.com>
Date
Oct 4, 2017, 17:46 UTC
Message-ID
<878tgqhkmb.fsf@gmail.com>
In-Reply-To
<20171004170532.6pjcwdurcokpvcop@sigill.intra.peff.net>
Thanks for pointing out the option. 

I tried "git help push" and searched for "prompt", "interactive", "credentials"...

I don't think I would have figured to try
 "git help git" from "git help" even after reading it carefully.
I'd suggest adding a hint in "git help".
I also don't seem have the GIT_TERMINAL_PROMPT in "git version 1.8.3.1" but I can fix this.
Thanks,

Ernesto Jeff King <peff@peff.net> writes:

Show 33 quoted lines
> On Wed, Oct 04, 2017 at 09:10:48AM -0700, Ernesto Alfonso wrote:
>
>> Waiting for git-push synchronously slows me down, so I have a bash
>> alias/function to do this in the background. But when my origin is https, I
>> get an undesired interactive prompt. I've tried to disable by
>> redirecting stdin:
>> 
>> git push ${REMOTE} ${BRANCH} &>/dev/null </dev/null
>> 
>> but I still get an interactive prompt.
>> 
>> Is there a way to either
>> 
>> 1. disable interactive prompting
>> 2. programmatically determine whether a git command (or at least a git
>> push) would interactively prompt
>
> I assume the prompt is for credentials, since that's generally the only
> thing git-push will prompt for.
>
> Try:
>
>   $ git help git | sed -ne '/PROMPT/,/^$/p'
>          GIT_TERMINAL_PROMPT
>            If this environment variable is set to 0, git will not prompt on
>            the terminal (e.g., when asking for HTTP authentication).
>
> Of course that just stops the prompting. If Git needs a credential and
> you don't provide it, then the push will fail.
>
> For advice on that that, try "git help credentials".
>
> -Peff
Previous: Jeff King
Message 5 of 5 in “disable interactive prompting”
  1. Ernesto AlfonsoOct 4, 2017
  2. Jonathan NiederOct 4, 2017
  3. Ernesto AlfonsoOct 4, 2017
  4. Jeff KingOct 4, 2017
  5. Ernesto AlfonsoOct 4, 2017

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.