Trying to redirect 'git gc' output

前端 未结 2 1363
心在旅途
心在旅途 2021-01-18 04:14

I have a @daily job in the crontab that runs git gc on all the repos. I\'m trying to set up a log file for the job but I/O redirection does not pro

2条回答
  •  [愿得一人]
    2021-01-18 04:59

    You can try this:

    script -q -c 'git gc' > log

    Or this (with more readable output):

    script -q -c 'git gc' | sed 's/\r.*//g' > log

提交回复
热议问题