利用GIT自动部署代码

系统环境 CentOS

1.安装git

$ yum install git

2.设置

cd 项目位置
git init .
git config receive.denyCurrentBranch ignore
git config --bool receive.denyNonFastForwards false
cd .git/hooks
wget https://gist.githubusercontent.com/volca/9482044/raw/344a590af350b997db3819fa21426dfe8bc140f4/post-update
chmod +x post-update

3.本地设置

[remote "prod"]
        url = 用户名@IP或域名:项目路径

4.完成!

posted @ 2016-06-08 00:18  boystar  阅读(162)  评论(0编辑  收藏  举报