Git in a web development team using 1 remote development server and local environment

I work in a web agency with a small team (5 developers, 2 designers). We mainly work with PHP / MySQL web applications, including Magento, Experession Engine and CakePHP. We use a combination of PC (developers) Windows 7 and Mac on OSX (designers).

I studied using github for our projects with three main goals:

  • To find out who edited the files and let people comment on the files.

  • To avoid overwriting each other, work as you would in the case when several people can simultaneously work on the same file.

  • Allow rollbacks to previous versions of the file.

This is our current workflow, and I don't understand how github fits into this at all. I understand that our workflow needs to be changed, but I could not find a process that somehow seems to fit into this:

  • All our work is performed on a remote web server, which is specifically designed for development (there is nothing "alive" here). The server runs Apache, PHP, MySQL, etc. The local development environment is not installed on our machine, and we do not want this to be possible.

  • We all have FTP access to the development server mentioned above. We usually edit files directly on this dev server, as it provides a very quick way to check everything (literally edit the file, upload it and launch it in the browser). There are problems with conflicts, for example. several people are trying to edit the same file, so I am studying using git.

  • When everything is approved on the development server, it runs in real time, copying it to another server. A live server can be anywhere - we use some servers that we manage ourselves, sometimes we use third-party hosting companies - it changes.

I have been considering this over the past few days, and all the approaches that I find seem impossible to us. Does anyone have an idea of โ€‹โ€‹the best way to achieve this? Or am I looking for something that is not even applicable for the problems I'm trying to solve?

I would be grateful for any useful advice that people can offer.

Thanks.

+7
git github php web
source share
2 answers

You can create a git repository on your test machine and use each of your git commands to make changes to that repository. Thus, they will be notified when their changes conflict with other people's changes.

A typical workflow might look like this:

  • Developer1 is changing something on his machine.
  • Designer1 modifies some files on his computer.
  • Designer1 pushes these changes to its local git repository
  • Developer1 commits these changes to its local git repository
  • Developer1 pushes its changes to the development machine.
  • Designer1 pushes his changes to the development machine
    • in the event of conflicts with changes, Developer1 will now be prompted that these conflicts will need to be resolved.
    • Then the allowed changes will be transferred to the development machine.

This should fix your problem 1.) and 3.) and make 2.) an explicit action, which means that your developers and designers will see that they are redefining. If changes occur in different parts of the file at the same time, then git can save both changes without the need for further interaction.

But be careful that this is still a problem, that no one can check their own changes without the intervention of other people, because they can make a difference at any time while someone is trying to check something. With just one development machine, you cannot prevent this with just git. Since your team is quite small, and your current approach does not fix this, this may not matter much to you.

0
source share

We have a very similar job at the company I work for. In fact, we have different sandboxes on the dev server. In other words, we clone the repos in different sandboxes. Each developer / designer receives a sandbox. For example, if there are 3 developers, there will be 3 sandbox directories + 1 intermediate directory

So, the developer john gets /home/john/example.com and can be viewed at john.example.hot (setting up vhosts) mike gets /home/mike/example.com a look at mike.example.com tracy gets / home / tracy /example.com view on tracy.example.com And there will be another additional directory. /home/staging/example.com staging.example.com

Staging brings all the changes together so that they can be tested. All of these directories are only available with internal IPS.

We are introducing these changes into production using RSYNC. Additional information here about RSYNC: http://www.cyberciti.biz/tips/linux-use-rsync-transfer-mirror-files-directories.html

+1
source share

All Articles