在git bare repo 中的hooks目录里添加,post-receive文件

#!/bin/sh

cd path to your wiki dir
echo running in $PWD

git --git-dir ./.git  pull master master
echo "finish pull..."

并且记得给这个文件添加可执行权限
注意加上--git-dir 参数,详情看这里git-post-receive-hook-with-git-pull-failed-to-find-a-valid-git-directory
这样你在本地做了push后,在服务器上就能自动更新了