Bit of a generalised "what do you think the best solution is" question, but I've read and I've read and I don't seem to find all the answers to all my questions.
I work at a small web agency with 3 devs (2 onsite 1 offsite) where we're still using FTP (style-1.css, style-2.css) working on sites hosted online at a preview url, we then download the finished work and re-upload it to it's live url. It's pretty old school and completely wrong by today's standards I know, so I've started to look at Git. I'd like to be able to use it to manage the deployment as well.
What I'd like to be able to do is this:
- Dev works locally
- Dev pushes to preview/staging on server (publicly accessible)
- Client approves
- Dev pushes preview to live / dev tells live to pull from preview
What I'd like to know is:
- Can I set up the remote repo on the server to hold all the files we're working on, so we can point a url to these files to use as a preview/staging site? (ie why have I read that this should be a bare repo?)
- What's the best way to set up the 'live' site in this scenario? Could someone please explain how I could set up a command (a hook?) to pull from the preview site into the live site when we deem it stable?
I've tried reading into work flows but I haven't found how to use this in a live publicly(client) accessible work flow
Thanks in advance!
Edit
I've received a suggestion to use GitHub and I'd rather not use it for this since we have our own dedicated server and I don't mind putting in the time to learn and set it up correctly. (I'll be using GitHub for personal work so I'm not knocking it as a service)
The title includes Gitolite because I had originally intended to ask how to set this up using gitolite but in the middle of writing it I figured I'd get the basics right and so edited it out, must have forgotten to remove it from the title. If anyone has any suggestions for this that include gitolite I'd be willing to give it a shot.
Thanks for the suggestions so far