Git and development for a solo developer

I hope that some recommendations will help to improve the development workflow. I am a solo developer who currently works with several sites on a dedicated Centos server, and so far I have just developed locally on my machine and uploaded to the server using FTP. I want to improve this setup by introducing Git for version control and using an intermediate process, from local to production.

I installed Git on my production server, and I started creating repositories for each of my live sites (with .git inside the same directory as the live project). I still need to learn how to use Git correctly, but is it desirable to have this type of setup?

In terms of having an intermediate site for each project, I think that I'm just starting with subdomains for every live site that still lives on the same server.

At a basic level, does this type of setup make sense? Thanks for any pointers!

+8
git version-control development-environment
source share
2 answers

This is the approach that I use for my personal projects, and it has served me excellently for a very small number of very small sites. I usually trick a small shell script that pulls changes, adjusts permissions, runs any pending migrations, etc. Just make sure your .git directory exists outside of the public web root (potentially a problem for from scratch PHP sites, not so much with Rails, or with most PHP frameworks).

However, at work, where we have many large sites, it becomes quite tiresome to manually make changes, start migration, configure permissions, etc. We use a system called Capistrano , which will perform the above steps (and many others) automatically. There is even a very user-friendly web interface, Webistrano .

+3
source share

In addition to the development cycle, people also used Git for deployment.

See question for some pointers. The idea is basically to have Git installed on the production and middleware server, and also have some scripts to automatically pull changes from a particular branch and copy them to your web server.

+1
source share

All Articles