Pregunta

I am a php programmer and I am building an application.

I have a testing server(pagodabox) and a production server.(EC2).

After each task is completed I do a commit and push to testing server using git to test. after several tasks are complete I want the changed files for all these tasks to be moved to my development server (EC2).

So how can I do this? Is there any way to move the changed files directly to production server?

Also is there any way to know the files changed for each task.

Both my testing server and production server has git installed.

¿Fue útil?

Solución

What is usually done is:

  • you push on the testing server on a test branch
  • when you are ready, you merge that test branch to master and push on the testing server on master.
  • you have a post-receive hook which, on push on master branch, will push to the bare repo on prod (as illustrated in "How to do branching approach for multiple sites?").
  • you have a post receive hook on prod repo which will checkout the working tree in the live folder upon reception of the new commits. (as explained in "git push origin master not pushing the files").
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top