bash:git pull有修改条件

时间:2015-01-11 16:54:42

标签: git bash git-pull

我想创建一个bash脚本,它将运行git pull并运行一些其他命令来更新项目的数据/缓存。

我想只在git pull命令更新了项目时才运行这些命令(检索了新的提交)。

这样的事情会很好:

#!/bin/bash

git pull
if *git pull brought new commits*; then
    # run update cache commands
fi

git pull输出上的grep过滤器可以解决问题,但我正在寻找更清洁的解决方案。

0 个答案:

没有答案