0

We (2 developers) are developing a cakephp app that is running on a remote server. In NetBeans we both have project set up as "PHP application from remote server". The problem is that whenever one of us modifies any of the files, they get instantly updated on the server, but not in the other developer's IDE. We have git + bitbucket set up, but that still looks somehow confusing

So I see two possible ways of doing it and please let me know if I am wrong.

First one:

1.) We keep on developing the project as "PHP application from remote server" 2.) Once one of us is done with his part, pushes it to the repo 3.) The other fetches, and pushes his commits for the other to fetch

But this way it is very confusing in the middle of a sprint, since the other develop had made changes to the script, and you see the system acting depending on those changes, but you cannot really see what exactly has been changed.

Second one:

1.) Develop separately on localhosts 2.) Push and fetch the changes 3.) Upload the project to the server

This way we loose the usage of server when developing. And it may bring a lot of trouble debugging once the changes are updated on the server

The questions are: are both of the views correct and we have to choose one, or do we skip/not know something that would help us in the proccess.

Any help, guidance or suggestions are much appreciated.

7

You should definitely go with developing on localhosts (or your own separate vhosts on the server - to be sure you run the application under the same environment) and push-pull changes to the production environment only from VCS.

Otherwise why use a VCS at all? Just for the fun of it and as a redundancy for tour code? Version-control systems are collaborative tools created with that specific goal in mind: collaboration. They have built-in conflict resolution and they make sure you don't override anyone else's work when you update a common (stage / test / production) environment.

As for the production server, you could write a small cronjob to do the pull in that machine every minute - as long as nobody uploads files directly (which would generate a conflict on pull after the file has been commited and pushed to the repo), then you're only pulling changes from the remote branch and everything should go smoothly with an automated process. But that's only if you want to really automate that - I recommend manual operations, and even that you would only do in a production environment when you are sure that you have a stable version. But for development & testing, separate virtual hosts on the same server should do the trick.

|improve this answer|||||
  • nice answer, good one. – Rocklan Sep 5 '14 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.