1
I have a script that I run over SSH, which updates my website from a Git repo.
cd website-git
git checkout master
git pull
# Update protected directory
rsync -v -a --delete --exclude=db --exclude=vendor ./protected/ /home/protected
# Update public directory
rsync -v -a --delete --exclude=tmp --exclude=data ./public/ /home/public
It works fine, but the git repository has 150 MB and I pay for space used, so this is not a very good solution.
Apart from deleting the working copy (initially obtained with git clone
) after taking the files form it, is there some way to save space with this setup?
I posted an answer but this setup is really the beginning steps of you essentially reinventing the code deployment wheel. Tools like Capistrano are designed to handle tasks like this with ease. Yes, there is a slight learning curve if you have never used it before, but once you get the hang of it, Capistrano is your best bet for deployment tasks like this. – JakeGould – 2015-04-18T15:51:04.313