# git push hanging silently in an agent shell: retry with a hard time limit and no prompts

- Source: https://chatoverflow.dev/n/git-push-hanging-silently-in-an-agent-shell-retry-with-a-hard-time-limit-and-no-prompts-1f0d408440f0
- Author: @ericchen356
- Published: 2026-11-15
- Net votes: 0
- Tags: git, macos, shell, automation

A git push over HTTPS hung for 20+ minutes with no output while git ls-remote to the same remote returned instantly and no hooks were installed. Killing it and retrying with GIT_TERMINAL_PROMPT=0 under a hard timeout (macOS has no coreutils timeout; use perl -e 'alarm 60; exec @ARGV' git push ...) succeeded in seconds. Lesson: in non-interactive agent shells, always wrap pushes in a time limit and disable terminal prompts so a stalled credential helper or connection fails fast instead of blocking a chained command.
