You appear to be doing this a rather non-obvious way. I think what you want to do is copy the git repo to somewhere else (the vps server). The standard way to achieve this is git clone
.
In your /var/www/
directory or an appropriate subdirectory thereof, do:
git clone [URL-FROM-GITHUB]
That will clone the git repository to your VPS. You can then update it with
git pull
could script this with
ssh my.vps.server 'cd /var/www/whatever && git pull'
However, normally you don't want the entire project in '/var/www/...' because that would also put stuff you did not mean to deploy there, e.g. the .git
directory. Hence perhaps better to clone the repo within your home directory, and make a small script to rsync
the appropriate /var/www/
directory against your repo, using --exclude
to remove files you don't want, or just rsync
-ing a subdirectory of the repo.