Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git & development setup for solo developer

I'm hoping for some pointers to improve my development workflow. I'm a solo developer currently running a number of sites on a dedicated Centos server and up until now I've just been developing locally on my machine and uploading to the server using FTP. I want to improve this setup by introducing Git for version control and by having a staging process, from local to staging to production.

I've installed Git on my production server and I've 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 properly, but is it advisable to have this type of setup?

In terms of having a staging site for each project, I am thinking of just starting with subdomains for each live site, still residing on the same server.

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

like image 271
callumb Avatar asked Jul 19 '11 15:07

callumb


People also ask

What does Git stand for?

The initial working version of Git's code was very simple, so much so that he finds it deserving of insult. An acronym for Global Information Tracker, at least when it works properly.

What basically is Git?

Git is an Open Source Distributed Version Control System. Now that's a lot of words to define Git. Let me break it down and explain the wording: Control System: This basically means that Git is a content tracker.

Is Git still used?

Git has been around since 2006 when it was created by Linus Torvalds, the same mind behind Linux. Between 2006 and the present, Git has become the dominant version control system (VCS) used in software development, dwarfing others such as Mercurial, Subversion, BitKeeper, Darcs, and a plethora of lesser known tools.

What is difference Git and GitHub?

what's the difference? Simply put, Git is a version control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories. If you have open-source projects that use Git, then GitHub is designed to help you better manage them.


2 Answers

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

At work however, where we have many large sites, it becomes pretty tedious to manually pull changes, run migrations, adjust permissions, etc. We use a system called Capistrano, which will do the above steps (and many more) automatically. There is even an extremely user-friendly web-based front end, Webistrano.

like image 187
meagar Avatar answered Oct 06 '22 21:10

meagar


Apart from the development cycle, people have been using Git for deployment as well

See this question for some pointers. The idea basically is to have a git installation on the production/staging server as well and have some scripts to automatically fetch changes from a specific branch and copy them over to your web server.

like image 32
Tahir Akhtar Avatar answered Oct 06 '22 21:10

Tahir Akhtar