Suppose we have a deploy.php script at /var/www/html/deploy.php that is called by a hook from a service such as Github or Bitbucket. We need to configure our web-server user, in this case it’s www-data, who’s default home directory is /var/www. Create .ssh directory and set permissions mkdir /var/www/.ssh chmod 0700 /var/www/.ssh chown -R www-data:www-data /var/www/.ssh […]
Tag: git
Pull Only 1 Directory From Git Repository
This can be done by setting up a sparse checkout. Sparse Checkout Create a directory mkdir [directory] Enter directory cd [directory] Git init and add remote git init git remote add origin [url] Enable sparse checkout git config core.sparseCheckout true Set folders to checkout in .git/info/sparse-checkout echo “[wanted directory]” >> .git/info/sparse-checkout Then pull the repository […]