I am working on a large php/mysql application, and I am getting to the point that i have to use some kind of version control. I have read a few articles on GIT, but i can’t seen to figure out what the best way is to go about this.
I have a dedicated server that runs CENTOS with PLESK. And i mainly develop on my local machine that on which u use XAMPP.
If i want to use version control should i install this on the server that uses PLESK, or should i install this on my local machine. And will this also record the database changes i made.
Another thing i question is the use of the github. Should I still upload the changes to the hub, or do i need to make my own place on the server where the source files are stored.
Thank you for your time!
The normal procedure would be to develop your software using version control. When you have a release that needs to go to the test or live server you would deploy the code from the repository to the test/live server.
If you are using GIT then it only needs to be on your machine as this is how GIT is designed, as a distributed version control system. If you were using Subversion then that may well reside on a server away from your machine. However in this instance you would still deploy in the same way.
It is not normal to add the database changes to version control for various reasons (there is discussion of that in other question here on SO)
You only need to use GitHub if you are working with other people or are opening your code up to the wide world to download and uses. However another reason for uploading to GitHub would be in case your local machine with all the code and the repository crashed and you lost the local copies you could recover from there. However i assume you are making backups?
Edit – addition
There is a free book which deals with git but to deal with below you add a file called gitignore and in it you add the file patterns that you do not want in the repository. so you have local config file and remote config files on the target server but they do mnot get overwritten as your local files are not in the repository