It has been 541 days since the last update, the content of the article may be outdated.
宝塔系统依托于 Centos
开发,所以我们服务器系统选择 Centos7+
安装宝塔
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
安装完成后,登录宝塔,首次登录会提示我们安装环境,我们勾选
Nginx
即可。
之后,我们在 home
文件夹下新建 git
,hexo
这两个文件夹
随后,我们登录我们的服务器,一次执行
cd ..
cd home
cd git
git init --bare blog.git
接着,在目录 /home/git/blog.git/hooks
下新建文件 post-receive
,写入一下代码
git --work-tree=/home/hexo --git-dir=/home/git/blog.