Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use Git for deployment of web apps?

I use Git to track local changes in my PHP web applications, and I was wondering if it would be a good idea to use Git on the server as well, so that I could just use git push to deploy my changes. Would there be any pitfalls with this approach?

like image 961
DLH Avatar asked Aug 20 '10 18:08

DLH


3 Answers

This seems like a nice way to do things. If you're tagging and branching properly it will enable you to quickly switch back to working versions of your site too in the event that something breaks.

like image 147
signine Avatar answered Nov 11 '22 17:11

signine


I think this is a fine way to do it. I handle things in a similar manner, where live sites are just a checkout from the repository, and i update them as necessary.

like image 39
GSto Avatar answered Nov 11 '22 17:11

GSto


Git is fine but you can do a lot better then just using git pull. Take a look at railess deploy for capistrano.

Capistrano basically does a combination of rsync and git pull to deploy copies of your website. It supports roleback, staging and distributed deployments.

like image 31
Ken Struys Avatar answered Nov 11 '22 18:11

Ken Struys