@s.k.paul mario suggested a good way. An alternative is to do git pull on your machine and use sftp to push it, however this would take longer time if project is huge.
GitHub provides the ability to download your repo as a zip file. So you could do that and then unzip it. Don't need PHP for that, standard command line tools can do it
https://github.com/VND/PKG/archive/master.zipwithcopy()and do some unzipping.