Fatal: could not read Password for terminal prompts disabled

I was recently trying to write back remote changes carried out by a build agent as part of a CI-CD task. I came across the following error: