4

want to commit, fix errors and send changes them to the GIT repository, but the number of messages exceeds the number of rows displayed in the Unix command line so I cant read error messages. How can I save GIT commit messages to the file or possibly increase the number of lines displayed on the Unix command line?

It seems that in this GIT build uses hooks, it shows messages like:

/usr/local/scripts/act check test-file --file-www/htdocs/doms/netflow/scripts/read.php --verbose
Logging output to toLogs
[ OK ]   php lint for /www/htdocs/doms/netflow/scripts/read.php - no errors
[ OK ]   code-wrangler audit-php for /www/htdocs/doms/netflow/scripts/read.php - no errors
[ OK ]   No Errors Detected

Thanks.

Sergey Novikov
  • 4,096
  • 7
  • 33
  • 59
  • What do you mean by "commit messages"? Are you using `git log`? If so, you can scroll down with `j`, or you can output it to a file with `git log > log.txt` – Leigh Dec 16 '13 at 07:06
  • I updated my question, I apologize for not giving all the information at once. – Sergey Novikov Dec 16 '13 at 07:14

1 Answers1

3

For redirecting stdout and stderr for a git command, you can do:

git commit -m "your message" 2>&1 | cat >> log &

(as suggested in "Trying to redirect 'git gc' output")
Or:

script -q -c 'git commit -m "your message"' > log
script -q -c 'git commit -m "your message"' | sed 's/\r.*//g' > log

You can try and desactivate the pager to make sure to get the full log

 git --no-pager log --decorate=short --pretty=oneline > alog.txt
 # or
 GIT_PAGER="cut -c 1-${COLUMNS-80}" git log

See more at "How to make git log not prompt to continue?"

(This differs from the pager settings you can set for long lines, as in "git diff - handling long lines?")

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250