Suppress all git warnings


I’m calling git log from MATLAB to find out last commit hash and get a ‘terminal is not fully functional’ warning.

I don’t want to fiddle around various git settings or exporting the right TERM variable (tried TERM=dumb – didn’t work).

Is there a way to supress all git warnings, or at least make git not require pressing enter after each of them?


OK, the answer is to use –no-pager option e.g. like this

git --no-pager log -1 --format="%H" 

But to answer question in title, use 2>/dev/null, like:

git status 2>/dev/null

Answered By – Hennadii Madan

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published