Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress all git warnings

Tags:

git

matlab

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?

like image 218
Hennadii Madan Avatar asked Aug 17 '26 13:08

Hennadii Madan


1 Answers

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
like image 104
Hennadii Madan Avatar answered Aug 20 '26 03:08

Hennadii Madan