git - How do you override the stat width in git pull?
问题描述
When running git log
, you can specify eg --stat=180
to override the width of the stats graph. git pull
has a --stat
option but it doesn't take a width.
Context: I'm calling git pull
over ssh in a cron job. It falls back to a default width of 80, which isn't what I want. There's no tty, so I can't set the width with stty
.
解决方案
Option --stat
takes no value in git pull
but you can use a different command like git diff
. You need to write down the current head commit, run git pull
and then git diff --stat
:
prev_commit=`git rev-parse HEAD`
git pull
git diff --stat=180 $prev_commit
推荐阅读
- sql - Conflict on two PostgreSQL transactions with serializable isolation level
- react-native - Use redux-persist instead of local DB for big data? React Native
- jquery - 确保控制器方法实际上是由 ajax 或 mvc 中的 POST 请求调用的
- jquery - Minify Arrays with chrome set
- python-3.x - 如何在 if 语句中正确构建“分数小于 10 或大于 90”?
- python - 将科学论文 PDF 从一种名称模式重命名为另一种名称模式
- installation - What error message get while failed to start/stop the service?
- android - Is there any way to select a custom color space for recording in Android?
- javascript - BotUI: Timestamps in speech bubbles
- powershell - I try to run angular 'ng serve' absolutely new project and I get a lot of errors. A project run only from C:\Windows\System32