I have a site running on django, (but the question applies to anything, php, etc)
Currently I’m using unison to deploy my changes, and I (kinda used to) love it because before that I was doing it manually!!
Now, as I’m getting my feet wet with git, I’m starting to love it! And I’m thinking if maybe I should use it instead of unison to deploy my changes!
This way I’ll have the added benefit of being able to revert my changes if somehow deploying them turned out to be a disaster!
The question is:
-
Is git suitable for deploying websites?
-
Any things/issues/gotchas that I should be aware of?
I use git to track my website, and I deploy it like this:
This deserves a little explanation. The archive command for git will export the files for the master branch, which gets compressed with gzip to minimize network traffic. It’s received remotely over ssh, which is decompressed into the final destination directory.
The deploy script that I use has a little more going on, but this is the most important piece.