Git "could not read Username" with no terminal in CI
By Kaveh Alemi·Latchkey
Git had no credential to use and tried to prompt for one, but CI has no interactive terminal, so the read fails immediately. The real problem is that no token or helper was configured.
What this error means
A clone, fetch, or submodule update fails with fatal: could not read Username for the HTTPS remote: No such device or address. It never hangs; it errors at once.
git
fatal: could not read Username for 'https://github.com': No such device or address
Diagnose it: depth, refs, or credentials?
Terminal
git rev-parse --is-shallow-repository
git rev-parse --abbrev-ref HEAD # prints HEAD when detached
git log --oneline -3
git remote -v
Common causes
No credential configured for HTTPS
No token in the URL, no credential helper, and no stored credential, so Git falls back to an interactive prompt that cannot run.
Submodule URL without credentials
A submodule references an HTTPS URL that has no token, even when the parent clone was authenticated.
How to fix it
Provide a non-interactive credential
Inject a token into the clone URL or configure a credential helper.
Disable interactive prompting so failures surface clearly rather than hanging.
Always configure an explicit token or credential helper for HTTPS Git in CI, and set GIT_TERMINAL_PROMPT=0 so missing credentials fail fast instead of stalling.
Frequently asked questions
What causes Git "could not read Username" with no terminal in CI?
There are 2 common causes: no credential configured for https and submodule url without credentials. No token in the URL, no credential helper, and no stored credential, so Git falls back to an interactive prompt that cannot run.
How do I fix Git "could not read Username" with no terminal in CI?
There are 2 fixes depending on which cause you have: provide a non-interactive credential and rewrite auth for all github.com urls. Work through them in order, since the first is the most common.
What does Git "could not read Username" with no terminal in CI actually mean?
A clone, fetch, or submodule update fails with fatal: could not read Username for the HTTPS remote: No such device or address.
How do I stop Git "could not read Username" with no terminal in CI happening again?
Always configure an explicit token or credential helper for HTTPS Git in CI, and set GIT_TERMINAL_PROMPT=0 so missing credentials fail fast instead of stalling.