【发布时间】:2011-11-20 12:10:10
【问题描述】:
我在 GIT 中遇到过这种情况:
我想在推送中更改特定文件时对其“做某事”。 例如,如果 .sql 文件发生更改,则必须将其转储到数据库中。
我在 GIT 中使用 'post-receive' 挂钩,声明如下:
DUMP=$(git diff-tree --name-only -r -z master dump.sql);
if [ -n "$DUMP" ]; then
// using the new dump.sql
fi
如何访问刚刚从钩子中推送的新dump.sql?
【问题讨论】:
标签: git git-post-receive