My friends and I want to make a website using the CodeIgniter PHP framework. We rent a VPS which runs Cent OS 6.4.
As we developed the website, we met a problem: After user A changed something in var/www/application, A must inform B and C that he has changed something, and B and C must then download the new version and try to find out the difference between the new file and the old file (especially when this file had also been changed by B or C at the same time). We managed to use git to solve this problem. We installed gitolite in the server.
However, we now have another problem: after we push changes, we want to push the file directly into var/www/application, so we can test it directly in browsers.
My questions are,
user: password:
It sounds like you're wanting to use Git for deployment. git push
is what you use to push to a remote repo, not to some directory somewhere. What you really need is a script that does a git pull
, and then possibly a git checkout
to fetch the updated code from the repo, and switch to whatever branch you're using for deployment (unless you use master, then you can just stay on master all the time).
Depending on where you host your repo, you can set up a hook so that it will hit a URL on your server when new code is ready to grab.