For Bash users, you can use the $COLUMNS to automatically fill in the available terminal width:
git diff --stat=$COLUMNS
Very long path names can be truncated; in this case, you can reduce the width of the +++ / --- part using --stat-graph-width , for example, this limits it to 1/5 of the terminal width:
git show --stat=$COLUMNS --stat-graph-width=$(($COLUMNS/5))
For a more general solution, you can use the output of tput cols to determine the width of the terminal.
John Mellor May 24 '13 at 10:54 2013-05-24 10:54
source share