Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Droopy4096 for deploy development and master branch on server with git

according to article at digitalocean instead of GIT_WORK_TREE you need a combo of --work-tree and --git-dir options:

git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f

and for post-receive script it ends up being slightly different construct than what you have:

#!/bin/bash
while read oldrev newrev ref
do
    if [[ $ref =~ .*/master$ ]];
    then
        git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f
    fi
done

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>