Together with a friend we are looking to develop a website (using Symfony2). We are on a Shared Hosting with SSH access.

Below is the environment we'd like to setup:

* Use git as Version Control (we are new to Git)
* Share the tasks and develop on our local machines
* Push the updates onto the remote server

Here's our initial thoughts on how to do it (assuming Git is already running both locally and remotely):

* Install Symfony on the Remote Server (basic setup)
* Get a clone (using Git) of the project locally
* Develop project locally and push updates (using Git) on the remote server

Does this approach make sense, if not, any recommendations?



I personally use Git for web development, and have adopted a method similar to this with our development server. I used Joe Maller's Web-Focused Git Workflow as a model, and it's been fairly successful.

Joe's approach uses an intermediary "hub" repository that's been set up as a "bare" repository (git --bare init), because it's very tricky pushing into a working repository. Git seems much more happy when you pull from other repositories, which is why you'll hear a lot about "pull requests" in community projects.

From there, the dev server (or in your case, your shared hosting) is updated using post-commit and post-update hooks that pull the changes in from the hub repository. This allows your team to push changes upstream into the hub, and automatically update your shared hosting account from the same repository.

You might have to modify it a bit to match your environment, but I think it would accomplish everything you're looking for.


As stated by @Jacob Hume I'd have an intermediary repository, setup your own, use Github or Bitbucket. You are likely going to run into difficulty synchronizing your branches between multiple developers if you don't use a hub. I usually pull updates into a staging/testing server to make sure everything is working, then do the same for production.

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