0

What is the correct way to skip prompt when running a subprocess such as git push

import subprocess as sp
sp.run(['git', 'push', 'origin', 'HEAD'], stdout=sp.PIPE, stderr=sp.PIPE, check=True)

I want it to throw a CalledProcessError if the remote ask for credentials (as if you type it wrong)

Edit :

@Rex Low : Possible duplicate of check output from CalledProcessError

even with check_output it opens a prompt in the serveur terminal

brospars
  • 11
  • 5

0 Answers0