I'm writing a program that speeds up the
git-autologin | git push
git-autologin > file.txt
You can detect when stdout is a terminal by using (on Linux & POSIX!) the isatty(3) function, probably as
So you could guess that if
isatty(STDOUT_FILENO) is false, the standard output is would be redirected or piped.
Alternatively, use fstat(2) as
But you should set up
ssh correctly (with credentials, STFW for any SSH tutorial!) on your system, to avoid having
git asking any password.