【发布时间】:2015-02-09 20:11:36
【问题描述】:
我只是想运行一个 git hook(post-merge) 来验证最近的 pull 中发生了哪些变化。
这是我的合并后脚本
#/usr/bin/env bash
echo "======> following are changes made to local repo <======"
git fetch && git log ..origin/master --pretty=format:"%s - %ar by %an (%h)"
echo "=======> ****************** <========"
我已授予必要的文件权限chmod +x post-merge
命令git fetch && git log ..origin/master --pretty=format:"%s - %ar by %an (%h)" 在我手动运行时运行完美。
但是当我执行git pull origin master 时,它只显示
echo "======> following are changes made to local repo <======"
echo "=======> ****************** <========"
因为git pull 执行git fetch 和git merge 我试过了
#/usr/bin/env bash
echo "======> following are changes made to local repo <======"
git log ..origin/master --pretty=format:"%s - %ar by %an (%h)"
echo "=======> ****************** <========"
我哪里出错了?
git 版本 1.9.1
谢谢
【问题讨论】: